From 18a078f968072990cc50f96d4b6e47b32a6001c5 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 1 Nov 2021 20:06:58 -0600 Subject: [PATCH] [vector] Implement move assignment using swap --- src/hb-vector.hh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/hb-vector.hh b/src/hb-vector.hh index d3a5dffac..af07c28be 100644 --- a/src/hb-vector.hh +++ b/src/hb-vector.hh @@ -110,11 +110,7 @@ struct hb_vector_t } hb_vector_t& operator = (hb_vector_t &&o) { - fini (); - allocated = o.allocated; - length = o.length; - arrayZ = o.arrayZ; - o.init (); + hb_swap (*this, o); return *this; }