u3: moves u3_put immediately after internals
@@ -214,6 +214,25 @@ _ch_slot_put(u3h_slot* sot_w, u3_noun kev, c3_w lef_w, c3_w rem_w, c3_w* use_w)
}
}
+/* u3h_put(): insert in hashtable.
+**
+** `key` is RETAINED; `val` is transferred.
+*/
+void
+u3h_put(u3p(u3h_root) har_p, u3_noun key, u3_noun val)
+{
+ u3h_root* har_u = u3to(u3h_root, har_p);
+ u3_noun kev = u3nc(u3k(key), val);
+ c3_w mug_w = u3r_mug(key);
+ c3_w inx_w = (mug_w >> 25); // 6 bits
+ c3_w rem_w = CUT_END(mug_w, 25);
+
+ _ch_slot_put(&(har_u->sot_w[inx_w]), kev, 25, rem_w, &(har_u->use_w));
+ if ( har_u->max_w > 0 ) {
+ u3h_trim_to(har_p, har_u->max_w);
+ }
+}
+
/* _ch_trim_node(): trim one entry from a node slot or its children
*/
static c3_o
@@ -395,25 +414,6 @@ u3h_trim_to(u3p(u3h_root) har_p, c3_w n_w)
}
}
-/* u3h_put(): insert in hashtable.
-**
-** `key` is RETAINED; `val` is transferred.
-*/
-void
-u3h_put(u3p(u3h_root) har_p, u3_noun key, u3_noun val)
-{
- u3h_root* har_u = u3to(u3h_root, har_p);
- u3_noun kev = u3nc(u3k(key), val);
- c3_w mug_w = u3r_mug(key);
- c3_w inx_w = (mug_w >> 25); // 6 bits
- c3_w rem_w = CUT_END(mug_w, 25);
-
- _ch_slot_put(&(har_u->sot_w[inx_w]), kev, 25, rem_w, &(har_u->use_w));
- if ( har_u->max_w > 0 ) {
- u3h_trim_to(har_p, har_u->max_w);
- }
-}
-
/* _ch_buck_hum(): read in bucket.
*/
static c3_o
