Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!ucbvax!ARIZONA.EDU!ralph From: ralph@ARIZONA.EDU ("Ralph Griswold") Newsgroups: comp.lang.icon Subject: Re: cset comparisons Message-ID: <8909121438.AA07886@megaron.arizona.edu> Date: 12 Sep 89 14:38:14 GMT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 24 The correct comparison operation to use is c1 === c2 provided both c1 and c2 are csets (=== does no type conversion). For csets, the bits are compared in about as fast a way as possible. If you write c1 == c2 both operands are converted to strings and then compared. Slow and it also requires storage allocation. Incidentally, to find out if a cset is empty, it's probably better to use *c1 = 0 I'm not positive about this; would have to do timings. The size of a cset is computed only when it's first needed. IF it's used the second time, it's available without additional computation. Ralph Griswold / Dept of Computer Science / Univ of Arizona / Tucson, AZ 85721 +1 602 621 6609 ralph@Arizona.EDU uunet!arizona!ralph