diff options
author | Russ Cox <rsc@golang.org> | 2010-05-19 21:33:31 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2010-05-19 21:33:31 -0700 |
commit | 2a32856c17d706f44023f9e15c872d5bb3a40177 (patch) | |
tree | 8690e50b84b38c5b588ddd6b8faf1c047f823935 /src/pkg/runtime/iface.c | |
parent | bbb192cb4821a779e9f20063562b8ba226df63ab (diff) | |
download | go-2a32856c17d706f44023f9e15c872d5bb3a40177.tar.gz |
runtime: avoid allocation for fixed strings
R=r
CC=golang-dev
http://codereview.appspot.com/1083041
Diffstat (limited to 'src/pkg/runtime/iface.c')
-rw-r--r-- | src/pkg/runtime/iface.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pkg/runtime/iface.c b/src/pkg/runtime/iface.c index 9c2c6b1b5..55a1362c6 100644 --- a/src/pkg/runtime/iface.c +++ b/src/pkg/runtime/iface.c @@ -467,7 +467,7 @@ ifacehash1(void *data, Type *t) if(algarray[alg].hash == nohash) { // calling nohash will panic too, // but we can print a better error. - ·newErrorString(catstring(gostring((byte*)"hash of unhashable type "), *t->string), &err); + ·newErrorString(catstring(gostringnocopy((byte*)"hash of unhashable type "), *t->string), &err); ·panic(err); } if(wid <= sizeof(data)) @@ -501,7 +501,7 @@ ifaceeq1(void *data1, void *data2, Type *t) if(algarray[alg].equal == noequal) { // calling noequal will panic too, // but we can print a better error. - ·newErrorString(catstring(gostring((byte*)"comparing uncomparable type "), *t->string), &err); + ·newErrorString(catstring(gostringnocopy((byte*)"comparing uncomparable type "), *t->string), &err); ·panic(err); } |