Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UniStr comparison #56

Open
bkamins opened this issue Mar 10, 2018 · 2 comments
Open

UniStr comparison #56

bkamins opened this issue Mar 10, 2018 · 2 comments

Comments

@bkamins
Copy link

bkamins commented Mar 10, 2018

  1. when hash caching is introduced we could use it to make a first-pass of string comparison try to use it if it is set and do more fancy comparison only if hashes match
  2. When comparing the same string, but of different type (eg. ASCIIStr and _UCS2Str - this is in general possible to get it) they compare using === as false. This is probably what we want (though normally identical strings compare as true under Julia 0.7 even if they have a different memory location), but I just want to make sure that this is intended.
@ScottPJones
Copy link
Member

ScottPJones commented Mar 10, 2018

I'm not sure I agree with with making === the same as ==, because it eliminates the possibility of shortcuts checking first for === and then for == (which can be slow for different string types).

I don't know where the change was made on master, and what rationale was given.

@bkamins
Copy link
Author

bkamins commented Mar 10, 2018

Good point. Let us use the rule for === from Base:
compares immutable objects (such as numbers) by contents at the bit level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants