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
, uintptr_t seed
,
15 uintptr_t key_size
__attribute__ ((unused
)))
24 key
= (const String
*) vkey
;
26 for (i
= 0, p
= key
->str
; i
< len
; i
++, p
++)
31 const FuncVal __go_type_hash_string_descriptor
=
32 { (void *) __go_type_hash_string
};
34 /* A string equality function for a map. */
37 __go_type_equal_string (const void *vk1
, const void *vk2
,
38 uintptr_t key_size
__attribute__ ((unused
)))
43 k1
= (const String
*) vk1
;
44 k2
= (const String
*) vk2
;
45 return __go_ptr_strings_equal (k1
, k2
);
48 const FuncVal __go_type_equal_string_descriptor
=
49 { (void *) __go_type_equal_string
};