aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2015-02-23 17:58:52 +0100
committerBjörn-Egil Dahlberg <[email protected]>2015-03-12 19:15:27 +0100
commit8c9341288af6b66f0fd5caf229c87af29c59e711 (patch)
tree7d7cfbf418bdb077dd1e02aa7966badb741c6476 /erts/emulator
parentad19eacbdb3b32bb74897ad2425808b9d669ccb8 (diff)
downloadotp-8c9341288af6b66f0fd5caf229c87af29c59e711.tar.gz
otp-8c9341288af6b66f0fd5caf229c87af29c59e711.tar.bz2
otp-8c9341288af6b66f0fd5caf229c87af29c59e711.zip
erts: Reindent erts_maps_update
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/beam/erl_map.c78
1 files changed, 39 insertions, 39 deletions
diff --git a/erts/emulator/beam/erl_map.c b/erts/emulator/beam/erl_map.c
index f99a1b431b..3e1092bfbe 100644
--- a/erts/emulator/beam/erl_map.c
+++ b/erts/emulator/beam/erl_map.c
@@ -698,56 +698,56 @@ BIF_RETTYPE maps_remove_2(BIF_ALIST_2) {
*/
int erts_maps_update(Process *p, Eterm key, Eterm value, Eterm map, Eterm *res) {
- Sint n,i;
- Eterm* hp,*shp;
- Eterm *ks,*vs;
- map_t *mp = (map_t*)map_val(map);
+ Sint n,i;
+ Eterm* hp,*shp;
+ Eterm *ks,*vs;
+ map_t *mp = (map_t*)map_val(map);
- if ((n = map_get_size(mp)) == 0) {
- return 0;
- }
+ if ((n = map_get_size(mp)) == 0) {
+ return 0;
+ }
- ks = map_get_keys(mp);
- vs = map_get_values(mp);
+ ks = map_get_keys(mp);
+ vs = map_get_values(mp);
- /* only allocate for values,
- * assume key-tuple will be intact
- */
+ /* only allocate for values,
+ * assume key-tuple will be intact
+ */
- hp = HAlloc(p, MAP_HEADER_SIZE + n);
- shp = hp;
- *hp++ = MAP_HEADER;
- *hp++ = n;
- *hp++ = mp->keys;
+ hp = HAlloc(p, MAP_HEADER_SIZE + n);
+ shp = hp;
+ *hp++ = MAP_HEADER;
+ *hp++ = n;
+ *hp++ = mp->keys;
- if (is_immed(key)) {
- for( i = 0; i < n; i ++) {
- if (ks[i] == key) {
- goto found_key;
- } else {
- *hp++ = *vs++;
- }
+ if (is_immed(key)) {
+ for( i = 0; i < n; i ++) {
+ if (ks[i] == key) {
+ goto found_key;
+ } else {
+ *hp++ = *vs++;
}
- } else {
- for( i = 0; i < n; i ++) {
- if (EQ(ks[i], key)) {
- goto found_key;
- } else {
- *hp++ = *vs++;
- }
+ }
+ } else {
+ for( i = 0; i < n; i ++) {
+ if (EQ(ks[i], key)) {
+ goto found_key;
+ } else {
+ *hp++ = *vs++;
}
}
+ }
- HRelease(p, shp + MAP_HEADER_SIZE + n, shp);
- return 0;
+ HRelease(p, shp + MAP_HEADER_SIZE + n, shp);
+ return 0;
found_key:
- *hp++ = value;
- vs++;
- if (++i < n)
- sys_memcpy(hp, vs, (n - i)*sizeof(Eterm));
- *res = make_map(shp);
- return 1;
+ *hp++ = value;
+ vs++;
+ if (++i < n)
+ sys_memcpy(hp, vs, (n - i)*sizeof(Eterm));
+ *res = make_map(shp);
+ return 1;
}
BIF_RETTYPE maps_update_3(BIF_ALIST_3) {