From: Archie Cobbs (archie@whistle.com)
Date: Mon Dec 21 1998 - 01:01:28 EST
Godmar Back writes:
> > The way I read this is that Java's Utf8s are meant to be compared with
> > strcmp. The GET macro should not be necessary.
>
> I meant the use of the GET macro in the method that compares them here.
That's how I took it..
> Of course, we could not use strcmp if there were alternate encodings
> for the same unicode character. From my reading of section 4.4.7, this
> does not seem to be the case.
Same here.
> I looked at the fake utf8 stuff and think I know what it does now.
> It's not exactly an elegant thing, but I guess it's okay.
Definitely not.. it's a localized optimization.
> One other thing I'd do is to compute the hash value for a faked utf8 up
> front, since you have to do it anyway.
> Then, utf8ConstHashValue(u) would simply be written as return u->hash;
> There's no need to compute the hash lazily anymore. (I think this only
> made sense to do lazily if utf8's were not interned.)
> Then you could put utf8ConstHashValue as a static inline in the header
> file.
Yes, you're right.. lazy eval works for String's but does no good
for Utf8Consts. Moreover, when creating a String from a Utf8Const,
we might as well copy the hash value since they're the same.
-Archie
___________________________________________________________________________
Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com
This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:57:26 EDT