File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 53
53
54
54
#include "sys-core.h"
55
55
56
+ // Use following define to speed map creation a little bit as the key words
57
+ // will not be normalized to set-words and or words when using words-of
58
+
59
+ //#define DO_NOT_NORMALIZE_MAP_KEYS
60
+
61
+ // with this define you would get:
62
+ // [a b:] = words-of make map! [a 1 b: 2]
63
+ // [a 1 b: 2] = body-of make map! [a 1 b: 2]
64
+ //
65
+ // else:
66
+ // [a b] = words-of make map! [a 1 b: 2]
67
+ // [a: 1 b: 2] = body-of make map! [a 1 b: 2]
68
+
69
+
70
+
56
71
57
72
/***********************************************************************
58
73
**
229
244
}
230
245
231
246
// Create new entry:
247
+ #ifndef DO_NOT_NORMALIZE_MAP_KEYS
232
248
// append key
233
249
if (ANY_WORD (key ) && VAL_TYPE (key ) != REB_SET_WORD ) {
234
250
// Normalize the KEY (word) to be a SET-WORD
238
254
} else {
239
255
Append_Val (series , key );
240
256
}
257
+ #else
258
+ Append_Val (series , key );
259
+ #endif
241
260
// append value
242
261
Append_Val (series , val ); // no Copy_Series_Value(val) on strings
243
262
369
388
out = BLK_HEAD (blk );
370
389
for (val = BLK_HEAD (mapser ); NOT_END (val ) && NOT_END (val + 1 ); val += 2 ) {
371
390
if (!IS_NONE (val + 1 )) {
391
+ #ifndef DO_NOT_NORMALIZE_MAP_KEYS
372
392
if (what < 0 ) {
373
393
// words-of
374
394
* out ++ = val [0 ];
375
395
if (ANY_WORD (val )) VAL_SET (out - 1 , REB_WORD );
376
396
}
377
397
else if (what == 0 )
378
398
* out ++ = val [0 ]; // body-of
399
+ #else
400
+ if (what <= 0 ) * out ++ = val [0 ]; // words-of or body-of
401
+ #endif
379
402
if (what >= 0 ) * out ++ = val [1 ]; // values
380
403
}
381
404
}
You can’t perform that action at this time.
0 commit comments