1 /* go-type-string.c -- hash and equality string functions.
3 Copyright 2009 The Go Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style
5 license that can be found in the LICENSE file. */
11 /* A string hash function for a map. */
14 __go_type_hash_string (const void *vkey
,
15 uintptr_t key_size
__attribute__ ((unused
)))
24 key
= (const String
*) vkey
;
26 for (i
= 0, p
= key
->str
; i
< len
; i
++, p
++)
31 /* A string equality function for a map. */
34 __go_type_equal_string (const void *vk1
, const void *vk2
,
35 uintptr_t key_size
__attribute__ ((unused
)))
40 k1
= (const String
*) vk1
;
41 k2
= (const String
*) vk2
;
42 return __go_ptr_strings_equal (k1
, k2
);