Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Apr 1997 15:41:13 +0930 (CST)
From:      Michael Smith <msmith@atrad.adelaide.edu.au>
To:        davem@jenolan.rutgers.edu (David S. Miller)
Cc:        dcs@gns.com.br, hackers@hub.freebsd.org
Subject:   Re: namei & hash functions
Message-ID:  <199704260611.PAA05947@genesis.atrad.adelaide.edu.au>
In-Reply-To: <199704252307.TAA11256@jenolan.caipgeneral> from "David S. Miller" at "Apr 25, 97 07:07:06 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
David S. Miller stands accused of saying:
>    From: "Daniel C. Sobral" <dcs@gns.com.br>
>    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  [[



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704260611.PAA05947>