Skip to content

Commit

Permalink
WString: Optimize a bit
Browse files Browse the repository at this point in the history
* move bodies of dtor, `init()` and `charAt()` to .h (implicitly inlined)

* unify descriptions of the initialization into one: `init()` (literally), that is called from each ctors, `invalidate()` and `move()`

* invert the SSO state logic in order to make init state zeroed (as a result, each inlined `init()` saves 1 insn)

* detab and trim

* remove `inline` from .h

* cosmetics

* optimize the non-SSO -> SSO transition part of `changeBuffer()`

* remove duped body of `operator =(StringSumHelper &&rval)`

* remove common subexpressions from `lastIndexOf()` and `substring()`

* eliminate `strlen(buf)` after calling `sprintf(buf, ...)` that returns # of chars written

* eliminate `len()` after calling `setLen(newlen)`

* make ctor`(char c)` inlineable

* optimize `setLen()`

* replace constant-forwarding overload functions with default argument ones

* optimize `concat(char c)`

IROM size @ FSBrowser: 304916 -> 304372 (saved 544 from master)
  • Loading branch information
jjsuwa-sys3175 committed Nov 13, 2020
1 parent c5c9f84 commit f2c7565
Show file tree
Hide file tree
Showing 2 changed files with 200 additions and 246 deletions.
Loading

0 comments on commit f2c7565

Please sign in to comment.