Skip to content

Add UTIL_IsStringEmpty helper, replace strlen()==0 pattern#85

Merged
jkivilin merged 1 commit intomasterfrom
add-util-is-string-empty
Mar 9, 2026
Merged

Add UTIL_IsStringEmpty helper, replace strlen()==0 pattern#85
jkivilin merged 1 commit intomasterfrom
add-util-is-string-empty

Conversation

@jkivilin
Copy link
Member

@jkivilin jkivilin commented Mar 9, 2026

Summary

  • Add inline UTIL_IsStringEmpty() helper in util.h that checks str[0] == '\0' instead of walking the string with strlen()
  • Replace strlen(in_name) == 0 in bot_chat.cpp with UTIL_IsStringEmpty(in_name)
  • Add 4 unit tests for the new helper

Closes #84

@jkivilin jkivilin merged commit 9adb6ab into master Mar 9, 2026
5 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.

Minor Performance fix

1 participant