From d32f97238c903765dec4e9a9f3cbfa5fd12cded6 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Mon, 10 Aug 2026 11:11:18 -0700 Subject: Chapter 25: Modules, Separate Compilation, and SSA Construction Co-authored-by: Hsiang-Ying Fu <66062782+fuhsnn@users.noreply.github.com> Co-authored-by: fuhsnn <66062782+fuhsnn@users.noreply.github.com> Co-authored-by: Symious <14933944+symious@users.noreply.github.com> Co-authored-by: Jun Kawasaki Co-authored-by: Claude Opus 5 --- .../com/seaofnodes/simple/progs/stringHash.smp | 30 ---------------------- 1 file changed, 30 deletions(-) delete mode 100644 src/test/java/com/seaofnodes/simple/progs/stringHash.smp (limited to 'src/test/java/com/seaofnodes/simple/progs/stringHash.smp') diff --git a/src/test/java/com/seaofnodes/simple/progs/stringHash.smp b/src/test/java/com/seaofnodes/simple/progs/stringHash.smp deleted file mode 100644 index 7344fcdd..00000000 --- a/src/test/java/com/seaofnodes/simple/progs/stringHash.smp +++ /dev/null @@ -1,30 +0,0 @@ -// -*- mode: java; -*- -struct String { - u8[] cs; - int _hashCode; -}; - -// Compare two Strings -val equals = { !String !self, !String s -> - if( self == s ) return true; - if( self.cs# != s.cs# ) return false; - for( int i=0; i< self.cs#; i++ ) - if( self.cs[i] != s.cs[i] ) - return false; - return true; -}; - -// Return the String hashCode (cached, and never 0) -val hashCode = { !String self -> - self._hashCode - ? self._hashCode - : (self._hashCode = _hashCodeString(self)); -}; - -val _hashCodeString = { !String self -> - int hash=0; - for( int i=0; i< self.cs#; i++ ) - hash = hash*31 + self.cs[i]; - if( !hash ) hash = 123456789; - return hash; -}; -- cgit v1.2.3