Convert luaS functions to TString methods#68
Merged
NiceAndPeter merged 1 commit intomainfrom Nov 22, 2025
Merged
Conversation
Completely removed all luaS_* functions and converted them to TString static methods and instance methods. No backward compatibility wrappers - all 86 callsites across 19 files updated directly. **Converted to TString static methods:** - luaS_hash → TString::computeHash() - luaS_sizelngstr → TString::calculateLongStringSize() - luaS_createlngstrobj → TString::createLongString() - luaS_newlstr → TString::create() (with explicit length) - luaS_new → TString::create() (null-terminated C string) - luaS_newextlstr → TString::createExternal() - luaS_init → TString::init() - luaS_resize → TString::resize() - luaS_clearcache → TString::clearCache() **Removed wrapper functions (callsites updated to use methods):** - luaS_hashlongstr(ts) → ts->hashLongStr() - luaS_eqstr(a, b) → a->equals(b) **Benefits:** - Better encapsulation: string operations are part of TString class - Cleaner API: TString:: namespace clearly indicates string operations - No backwards compatibility overhead - direct method calls - Improved code organization **Files modified:** 19 files, 86 callsites updated **Performance:** 4.13s avg (1.7% improvement over 4.20s baseline) ✅ **Tests:** All passing ✅
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completely removed all luaS_* functions and converted them to TString static methods and instance methods. No backward compatibility wrappers - all 86 callsites across 19 files updated directly.
Converted to TString static methods:
Removed wrapper functions (callsites updated to use methods):
Benefits:
Files modified: 19 files, 86 callsites updated Performance: 4.13s avg (1.7% improvement over 4.20s baseline) ✅ Tests: All passing ✅