Open delphidabbler opened 1 year ago
Need to check how this method is used. If calling code depends on out of spec behaviour then update comments else correct the code.
TREMLEntities.MapToEntity
gets called from this method:
This code tests the method's return value against the empty string, so this is what it is expecting.
So, it looks like the method acts as expected and the comments are wrong.
I think the actual behaviour is reasonable because the code is supposed to be return an entity if one exists. Furthermore, the calling code has to wrap the entity between &
and ;
characters, so the empty string result is useful to help deciding if this should be done.
Maybe renaming to MapToEntityIfExists
would clarify.
https://github.com/delphidabbler/codesnip/blob/02656b8417c2863a89cf2bf45e3be275ca9f94a9/Src/UREMLDataIO.pas#L904
Description says this function returns the character itself if it is printable ASCII, but it returns the empty string in this case.