summaryrefslogtreecommitdiff
path: root/src/map.c
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2015-05-02 12:32:04 -0400
committerAdrian Thurston <thurston@complang.org>2015-05-02 12:32:04 -0400
commit95da2c03497492692f818c1b722712c420c1eee7 (patch)
treeb10da1a0be444d61f077df548e433028e147ce3f /src/map.c
parent247fb560e1b656cca5b98b42076aade592bedc8f (diff)
downloadcolm-95da2c03497492692f818c1b722712c420c1eee7.tar.gz
downref find tree arg in MAP find (if tree)
Diffstat (limited to 'src/map.c')
-rw-r--r--src/map.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map.c b/src/map.c
index 2f851551..bb0858a9 100644
--- a/src/map.c
+++ b/src/map.c
@@ -557,16 +557,16 @@ MapEl *mapCopyBranch( Program *prg, Map *map, MapEl *el, Kid *oldNextDown, Kid *
static long map_cmp( Program *prg, Map *map, const Tree *tree1, const Tree *tree2 )
{
- if ( map->genericInfo->keyType == 0x7 ) {
+ if ( map->genericInfo->keyType == TYPE_TREE ) {
+ return cmpTree( prg, tree1, tree2 );
+ }
+ else {
if ( (long)tree1 < (long)tree2 )
return -1;
else if ( (long)tree1 > (long)tree2)
return 1;
return 0;
}
- else {
- return cmpTree( prg, tree1, tree2 );
- }
}
MapEl *mapInsertEl( Program *prg, Map *map, MapEl *element, MapEl **lastFound )