Skip to content

Instantly share code, notes, and snippets.

@treed
Created July 13, 2009 04:13
Show Gist options
  • Save treed/145926 to your computer and use it in GitHub Desktop.
Save treed/145926 to your computer and use it in GitHub Desktop.
.sub uniq :method
.local pmc uarray, hash, val
.local int i, len
uarray = new 'CardinalArray'
hash = new 'CardinalHash'
i = 0
len = self.'Elems'()
loop:
if i == len goto done
val = self[i]
hash[val] = 0
done:
uarray = hash.'keys'()
.return (uarray)
.end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment