[PD-dev] symbol comparison vs strcmp()
IOhannes m zmölnig
zmoelnig at iem.at
Thu Mar 11 19:26:51 CET 2021
hi all,
Pd uses a symbol-table for practically all of its string handling.
the main purpose of the the symbol table is, as i understand it, to make
string comparison super-fast (as there's no need to compare each
character but just a simple address).
now, looking at the code i see quite a number of places¹ where something
like this is used:
> strcmp(atom_getsymbolarg(i, argc, argv)->s_name, refstring);
what is the reason for this?
is it just out of habit (because in all the other projects you usually
use strcmp())
or because this is an attempt to not pollute the symbol table needlessly?
or am i missing something?
or should they just be replaced with symbol comparisions?
gmsadr
IOhannes
¹ i've counted about 135 of such uses (automatically; so I certainly
missed a few)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20210311/eaef6232/attachment.sig>
More information about the Pd-dev
mailing list