@monorail hmmmmmmm
@monorail I think a while loop would be better but I'm not sure I would give enough of a shit in a code review because either way would look Weird
@monorail here's my final answer:
let i = 0;
for (
let idx = currentSignal.length;
i < matches[0].length && matches[0][idx] === matches.at(-1)[idx];
idx += i++
);
@monorail probably should be ++i. oh well!
@wallhackio @monorail idx should increment by 1 which is not what either of those would do
@monorail @wallhackio damn holly how did you get so wise
@aescling @wallhackio by looking up "javascript shared prefix of multiple strings" on google and seeing a stack overflow page about it
@aescling @wallhackio oh sorry i thought this was a reply elsewhere
@aescling @wallhackio this one is a holly original wisdom
@monorail @wallhackio that is a good wisdom
@monorail @wallhackio baaaaall-eevee or not, i’m walking on air
@wallhackio @aescling @monorail Can you do something like idx++, i++?
@vaporeon_ @aescling @monorail yeah that's what i would do (actually I would do ++idx, ++i but it objectively doesn't matter)
@vaporeon_ @aescling @monorail also this thread makes me certain that "I'm not sure I would give enough of a shit in a code review because either way would look Weird" was the right answer all along
@wallhackio @vaporeon_ @aescling mr. wallhackio do you like my javascript https://git.hollymcfarland.com/monorail/DSCRTC/src/branch/main/dscrtc.user.js#bypass=true
@monorail @vaporeon_ @aescling ooooh yummy delicious iife
@wallhackio @vaporeon_ @aescling this is convention for userscripts you see
@wallhackio @vaporeon_ @aescling sometimes you have an iife that constructs a script tag and injects it into the DOM, that's also conventional (but not always necessary)
@monorail @vaporeon_ @aescling I will support iife usage even if its stupid, iifes give me life
@wallhackio @vaporeon_ @aescling it makes sense for userscripts because they like to pretend they live in their own little bubble but you absolutely can pollute the global namespace with them and cause big bad problems
@wallhackio @monorail @vaporeon_ please tell me you OiI’d that Iife
@wallhackio @monorail @vaporeon_ he didn’t :c
@aescling @wallhackio @vaporeon_ i have no idea what this means sadly
@monorail @aescling @vaporeon_ welcome to todays lucky 10000 https://www.youtube.com/watch?v=E3p_Crhi3K8
@wallhackio @aescling @vaporeon_ holy shit
sorry clodboy i’m sniping you on this one
re: sorry clodboy i’m sniping you on this one
@monorail @vaporeon_ @aescling my only note is to use matches.at(-1) instead of matches[matches.length-1] at line 53 but even so, your javascript is clod-approved
@wallhackio @vaporeon_ @aescling hooray hooray
i might fix that if i ever commit to this repo again
@wallhackio @aescling if you want to increment by 1 every time, one way i like to do that is with
+= 1