JossWhittle / FlintPlusPlus

Flint++ is cross-platform, zero-dependency port of flint, a lint program for C++ developed and used at Facebook.
Boost Software License 1.0
266 stars 21 forks source link

Optimize strings #19

Closed kanielc closed 10 years ago

kanielc commented 10 years ago
  1. Move strings we no longer need
  2. Append char to whitespace instead of string (of 1 char)
  3. Clear whitespace instead of = "" (tiny speed difference from benchmarking, nice to know anyway)
  4. Use const char * for startsWith, avoiding the creation of temporary string objects.

Next goal is to see if we can avoid having to put strings in Token, also maybe to change the munch functions to return (a better version of) StringRange, since it's still just a map into the input stream.