Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Depending on your usage it is not necessarily less optimal either.

You never need to walk the string to find the \0 byte. e.g. for strlen.

For short strings no heap memory needs to be allocated or deallocated.



It's really too bad though that the short string optimization capacity is neither standardized nor user-controlled.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: