timschmidt/repsnapper — comment on commit 40c2afcafd6bba31a4ff1ea8156e6f8cc840b851
File: src/gcode.cpp line 150
By phord:

buffer.find looks for M anywhere in the string, but then buffer.substr(1...) assumes the M was the first character in the string.

If we can assume that commands always START with the primary GCode command, then we can save a lot of time by converting this buffer.find's into buffer[0] and buffer[1] checks.