Post #2900480
2025-09-13 10:10 UTC
Let the composer display the original toot, along with "Your quote:", when quoting.
https://github.com/colinleroy/a2tools/commit/c559536f60c1e61ee1283db740dad660b633fea9
The `if(compose_mode[0] == 'r')` got replaced with a
switch() {
case 'r':
case 'q':
...
}
You guessed why, it is tighter than if(compose_mode[0] == 'r' || compose_mode[0] == 'q').
The cc65 optimizer is far from perfect, and that or'ed if would load the variable twice, get the first char of it twice, and compare it twice. With a switch, only the comparison is done twice.
Cost so far, +46 bytes - but we're not done yet, as sending the quote would, for now, make a reply!
#RetroComputing #Mastodon #AppleII
Replies (1)
-
@colin_mcmillen@piaille.fr 2025-09-13 10:29
About that... It was stupid to set my `compose_mode` var as a string mirroring its source argv[] and then check its first char using [0] everywhere. Set it as a char from the start, simplify every comparison, -84 bytes. https://github.com/colinleroy/a2tools/commit/0a72da76da429a20a2a53da749d46dd4a4ebc4c9 #RetroComputing #AppleII #Mastodon