From owner-freebsd-hackers Fri Apr 25 23:11:42 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id XAA07904 for hackers-outgoing; Fri, 25 Apr 1997 23:11:42 -0700 (PDT) Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id XAA07899 for ; Fri, 25 Apr 1997 23:11:39 -0700 (PDT) Received: (from msmith@localhost) by genesis.atrad.adelaide.edu.au (8.8.5/8.7.3) id PAA05947; Sat, 26 Apr 1997 15:41:14 +0930 (CST) From: Michael Smith Message-Id: <199704260611.PAA05947@genesis.atrad.adelaide.edu.au> Subject: Re: namei & hash functions In-Reply-To: <199704252307.TAA11256@jenolan.caipgeneral> from "David S. Miller" at "Apr 25, 97 07:07:06 pm" To: davem@jenolan.rutgers.edu (David S. Miller) Date: Sat, 26 Apr 1997 15:41:13 +0930 (CST) Cc: dcs@gns.com.br, hackers@hub.freebsd.org X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk David S. Miller stands accused of saying: > From: "Daniel C. Sobral" > Date: Fri, 25 Apr 1997 18:41:04 -0300 (EST) > > > > hash = hash * 33 + (unsigned char)*cp; > > I think hash += hash << 5 + (unsigned char)*cp; > would be better... > > Not really necessary, GCC can see the constant multiply: ... and on top of that, on an architecture where multiplying is faster than shift, add, it is likely to know this. -- ]] Mike Smith, Software Engineer msmith@gsoft.com.au [[ ]] Genesis Software genesis@gsoft.com.au [[ ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ ]] realtime instrument control. (ph) +61-8-8267-3493 [[ ]] Unix hardware collector. "Where are your PEZ?" The Tick [[