Skip to content

Conversation

@NiceAndPeter
Copy link
Owner

No description provided.

Removed the `lu_byte ctb(int)` overload from ltvalue.h as it was unused.
All ctb() calls in the codebase use LuaT enum values, which call the
`LuaT ctb(LuaT)` overload. This simplifies the API and removes dead code.

Analysis:
- Searched codebase for all ctb() calls
- All calls use LuaT::* enum values (SHRSTR, LNGSTR, etc.)
- Calls like ctb(s->getType()) pass LuaT (from GCBase::getType())
- No integer literals or LUA_T* macros passed to ctb()

Changes:
- src/objects/ltvalue.h:318 - Removed ctb(int) overload

Testing:
- Build: ✅ Success (no compilation errors)
- Tests: ✅ All pass ("final OK !!!")
- Performance: ~4.46s avg (within normal variance)
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)
@NiceAndPeter NiceAndPeter merged commit a1055c6 into main Nov 22, 2025
11 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants