Re: Fwd: Re: [Libreoffice-commits] core.git: Move string hash function into String class.

2014-02-18 Thread Muthu Subramanian
On 02/18/2014 05:53 PM, Stephan Bergmann wrote: While a well-designed interface between a base class and its derivations (of which virtual functions are a part) is desirable, a virtual function carries a relatively high maintenance cost. So please never declare functions as virtual until the

Re: Fwd: Re: [Libreoffice-commits] core.git: Move string hash function into String class.

2014-02-18 Thread Stephan Bergmann
On 02/15/2014 04:51 AM, Muthu Subramanian wrote: On 02/14/2014 09:39 PM, Stephan Bergmann wrote: Sure, but how exactly rtl::O[U]String::hashCode should behave is somewhat orthogonal to the point that the current design of SdPage::getHash is needlessly resource-hungry. And, as I wrote, "I wouldn

Re: Fwd: Re: [Libreoffice-commits] core.git: Move string hash function into String class.

2014-02-14 Thread Muthu Subramanian
On 02/14/2014 09:39 PM, Stephan Bergmann wrote: Sure, but how exactly rtl::O[U]String::hashCode should behave is somewhat orthogonal to the point that the current design of SdPage::getHash is needlessly resource-hungry. And, as I wrote, "I wouldn't mind changing the rtl string classes' hashC

Re: Fwd: Re: [Libreoffice-commits] core.git: Move string hash function into String class.

2014-02-14 Thread Stephan Bergmann
On 02/14/2014 04:11 PM, Muthu Subramanian wrote: On 02/14/2014 08:07 PM, Stephan Bergmann wrote: On 02/14/2014 03:24 PM, Muthu Subramanian wrote: How else would we build a hash value without too much work? If you have a structure consisting of multiple parts, compute hash values for the indiv

Re: Fwd: Re: [Libreoffice-commits] core.git: Move string hash function into String class.

2014-02-14 Thread Muthu Subramanian
On 02/14/2014 08:07 PM, Stephan Bergmann wrote: On 02/14/2014 03:24 PM, Muthu Subramanian wrote: How else would we build a hash value without too much work? If you have a structure consisting of multiple parts, compute hash values for the individual parts and fold them into a single hash valu

Re: Fwd: Re: [Libreoffice-commits] core.git: Move string hash function into String class.

2014-02-14 Thread Stephan Bergmann
On 02/14/2014 03:24 PM, Muthu Subramanian wrote: How else would we build a hash value without too much work? If you have a structure consisting of multiple parts, compute hash values for the individual parts and fold them into a single hash value via some suitable function, like f(x, y) = px

Re: Fwd: Re: [Libreoffice-commits] core.git: Move string hash function into String class.

2014-02-14 Thread Muthu Subramanian
On 02/14/2014 06:39 PM, Stephan Bergmann wrote: O(1) sampling was apparently considered state of the art when the rtl string classes were first created, closely copying java.lang.String, which at that time demanded sampling for hashCode(), too---but never sampling more than 15 characters, wi

Re: Fwd: Re: [Libreoffice-commits] core.git: Move string hash function into String class.

2014-02-14 Thread Stephan Bergmann
On 02/14/2014 11:01 AM, Muthu Subramanian wrote: a) Not sure what other things depend on hashCode - I assumed the functions which call that are ok with sampling based hash and needs it quick? b) argh :( I added the rtl parts, I guess I missed the helper part - will do. c) Oops will change t

Re: Fwd: Re: [Libreoffice-commits] core.git: Move string hash function into String class.

2014-02-14 Thread Muthu Subramanian
Hi Stephan, a) Not sure what other things depend on hashCode - I assumed the functions which call that are ok with sampling based hash and needs it quick? b) argh :( I added the rtl parts, I guess I missed the helper part - will do. c) Oops will change that d) Will add this as well e) th