Skip to content

Commit 0ca0e30

Browse files
committed
Phase 122: Remove 6 additional unused legacy functions from ltvalue.h
Removed unused legacy helper functions and lu_byte overloads: 1. val_() - Old Value accessor (4 overloads) - 0 usages 2. valraw() - Old Value accessor wrapper (2 overloads) - 0 usages 3. rawtt_byte() - lu_byte version of rawtt - 0 usages 4. ttypetag_byte() - lu_byte version of ttypetag - 0 usages 5. checktag(const TValue* o, lu_byte t) - lu_byte overload - 0 usages 6. settt_(TValue* o, lu_byte t) - lu_byte overload - 0 usages All current callers use LuaT enum types, making these legacy lu_byte overloads and wrappers unnecessary. This continues the modernization from Phase 122 Part 1 (removing ctb(int) overload). Analysis: - Searched codebase for usage of each function - All are either completely unused or have LuaT-based alternatives - All current checktag() calls use LuaT arguments - All current settt_() calls use LuaT arguments Changes: - src/objects/ltvalue.h: Removed 6 legacy functions/overloads - Total lines removed: 10 Testing: - Build: ✅ Success (no compilation errors) - Tests: ✅ All pass ("final OK !!!") - Performance: ~4.52s avg (within normal variance)
1 parent 4e21891 commit 0ca0e30

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

src/objects/ltvalue.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -276,16 +276,8 @@ class TValue {
276276
};
277277

278278

279-
/* Access to TValue's internal value union */
280-
constexpr Value& val_(TValue* o) noexcept { return o->valueField(); }
281-
constexpr const Value& val_(const TValue* o) noexcept { return o->valueField(); }
282-
constexpr Value& valraw(TValue* o) noexcept { return val_(o); }
283-
constexpr const Value& valraw(const TValue* o) noexcept { return val_(o); }
284-
285-
286279
/* raw type tag of a TValue */
287280
constexpr LuaT rawtt(const TValue* o) noexcept { return o->getType(); }
288-
constexpr lu_byte rawtt_byte(const TValue* o) noexcept { return o->getRawType(); } /* for legacy code */
289281

290282
/* tag with no variants (bits 0-3) */
291283
constexpr int novariant(int t) noexcept { return (t & 0x0F); }
@@ -296,7 +288,6 @@ constexpr int withvariant(int t) noexcept { return (t & 0x3F); }
296288
constexpr LuaT withvariant(LuaT t) noexcept { return static_cast<LuaT>(static_cast<int>(t) & 0x3F); }
297289

298290
constexpr LuaT ttypetag(const TValue* o) noexcept { return withvariant(rawtt(o)); }
299-
constexpr lu_byte ttypetag_byte(const TValue* o) noexcept { return static_cast<lu_byte>(withvariant(rawtt(o))); } /* for legacy code */
300291

301292
/* type of a TValue */
302293
constexpr int ttype(const TValue* o) noexcept { return novariant(rawtt(o)); }
@@ -307,7 +298,6 @@ constexpr LuaT TValue::typeTag() const noexcept { return withvariant(tt_); }
307298

308299
/* Macros to test type */
309300
constexpr bool checktag(const TValue* o, LuaT t) noexcept { return rawtt(o) == t; }
310-
constexpr bool checktag(const TValue* o, lu_byte t) noexcept { return rawtt(o) == static_cast<LuaT>(t); } /* overload for raw bytes */
311301
constexpr bool checktype(const TValue* o, int t) noexcept { return ttype(o) == t; }
312302

313303
/* Bit mark for collectable types */
@@ -326,7 +316,6 @@ constexpr LuaT ctb(LuaT t) noexcept { return static_cast<LuaT>(static_cast<int>(
326316

327317
/* set a value's tag */
328318
inline void settt_(TValue* o, LuaT t) noexcept { o->setType(t); }
329-
inline void settt_(TValue* o, lu_byte t) noexcept { o->setType(t); } /* overload for raw bytes */
330319

331320

332321
#endif

0 commit comments

Comments
 (0)