Skip to content

refactor: optimize string operations and improve code clarity#451

Merged
WiserTixx merged 2 commits intoBeamMP:minorfrom
Kipstz:refactor-string-optimizations
Jan 1, 2026
Merged

refactor: optimize string operations and improve code clarity#451
WiserTixx merged 2 commits intoBeamMP:minorfrom
Kipstz:refactor-string-optimizations

Conversation

@Kipstz
Copy link
Copy Markdown
Contributor

@Kipstz Kipstz commented Dec 24, 2025

  • Avoid redundant substr() calls in packet parsing hot-path (TServer.cpp)
    The previous code called substr(3) twice per packet, creating
    unnecessary temporary strings. Now stores the result once.

  • Replace .size() == 0 with .empty() for idiomatic C++
    (TConsole.cpp, TLuaEngine.cpp)

- Avoid redundant substr() calls in packet parsing hot-path (TServer.cpp)
  The previous code called substr(3) twice per packet, creating
  unnecessary temporary strings. Now stores the result once.

- Replace .size() == 0 with .empty() for idiomatic C++
  (TConsole.cpp, TLuaEngine.cpp)
@Kipstz Kipstz force-pushed the refactor-string-optimizations branch from 402e4b8 to b74f0c7 Compare December 27, 2025 22:46
@WiserTixx
Copy link
Copy Markdown
Collaborator

Is there any reason why you didn't use the pull request template?

@Kipstz
Copy link
Copy Markdown
Contributor Author

Kipstz commented Dec 29, 2025

Is there any reason why you didn't use the pull request template?

I didn't even notice there was a template.

@WiserTixx WiserTixx merged commit 6ec4106 into BeamMP:minor Jan 1, 2026
7 checks passed
@Kipstz Kipstz deleted the refactor-string-optimizations branch January 2, 2026 03:18
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.

2 participants