Momo: optimize empty strings? (wait)

This commit is contained in:
tildearrow 2024-06-02 03:47:09 -05:00
parent f052b4d55d
commit 52b45ef5ab

View file

@ -376,6 +376,7 @@ const char* momo_gettext(const char* str) {
return str;
}
if (str==NULL) return NULL;
if ((*str)==0) return str;
// TODO: optimize
for (size_t i=curDomain->firstString[(unsigned char)(str[0])]; i<curDomain->stringCount; i++) {
if (strcmp(curDomain->stringPtr[i],str)==0) {
@ -391,5 +392,7 @@ const char* momo_ngettext(const char* str1, const char* str2, unsigned long amou
return str2;
}
// TODO: implement
// gettext("") and take plural form metadata...
// then I don't know how are plural strings stored
return str1;
}