[map] Try moving items when resizing
diff --git a/src/hb-map.hh b/src/hb-map.hh
index 196b8e7..696cb87 100644
--- a/src/hb-map.hh
+++ b/src/hb-map.hh
@@ -159,17 +159,15 @@
 	if (old_items[i].is_real ())
 	  set_with_hash (old_items[i].key,
 			 old_items[i].hash,
-			 old_items[i].value);
+			 hb_move (old_items[i].value));
 
     hb_free (old_items);
 
     return true;
   }
 
-  bool set (K key, V value)
-  {
-    return set_with_hash (key, hb_hash (key), value);
-  }
+  bool set (K key, const V& value) { return set_with_hash (key, hb_hash (key), value); }
+  bool set (K key, V&& value) { return set_with_hash (key, hb_hash (key), hb_move (value)); }
 
   V get (K key) const
   {
@@ -239,7 +237,8 @@
 
   protected:
 
-  bool set_with_hash (K key, uint32_t hash, V value)
+  template <typename VV>
+  bool set_with_hash (K key, uint32_t hash, VV&& value)
   {
     if (unlikely (!successful)) return false;
     if (unlikely (key == kINVALID)) return true;