Issue with converting tiny classifier routine into a macro
Posted: Sun Jul 27, 2025 2:10 pm
Hi all,
I'm trying to refactor this small snippet into a macro, to reduce procedure call overheads, as this is one of multiple such routines that is used in a tight loop that runs millions of times before ending. Any function call omitted is a good thing. The code:
I have quite a few of similar classifier procedures that I all need to convert. Ideally, within the loop, I do not want procedure calls to the classifier and the Bool() contained within.
Any ideas?
cheers
Skipper
I'm trying to refactor this small snippet into a macro, to reduce procedure call overheads, as this is one of multiple such routines that is used in a tight loop that runs millions of times before ending. Any function call omitted is a good thing. The code:
Code: Select all
Procedure.i IsLetter(c.s)
Protected code = Asc(c)
ProcedureReturn Bool((code >= 65 And code <= 90) Or (code >= 97 And code <= 122) Or c = "_")
EndProcedure
Any ideas?
cheers
Skipper