diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc index 839a256d7..f5dc02f08 100644 --- a/src/hb-buffer.cc +++ b/src/hb-buffer.cc @@ -230,17 +230,6 @@ hb_buffer_get_language (hb_buffer_t *buffer) void hb_buffer_reset (hb_buffer_t *buffer) -{ - hb_buffer_clear (buffer); - - buffer->props = _hb_buffer_nil.props; - - hb_unicode_funcs_destroy (buffer->unicode); - buffer->unicode = _hb_buffer_nil.unicode; -} - -void -hb_buffer_clear (hb_buffer_t *buffer) { buffer->have_output = FALSE; buffer->have_positions = FALSE; @@ -250,6 +239,11 @@ hb_buffer_clear (hb_buffer_t *buffer) buffer->i = 0; buffer->out_info = buffer->info; buffer->serial = 0; + + buffer->props = _hb_buffer_nil.props; + + hb_unicode_funcs_destroy (buffer->unicode); + buffer->unicode = _hb_buffer_nil.unicode; } hb_bool_t diff --git a/src/hb-buffer.h b/src/hb-buffer.h index a2785eef0..49f6a49cd 100644 --- a/src/hb-buffer.h +++ b/src/hb-buffer.h @@ -102,10 +102,6 @@ hb_buffer_get_language (hb_buffer_t *buffer); void hb_buffer_reset (hb_buffer_t *buffer); -/* Clears buffer glyphs, but doesn't touch other buffer attributes. */ -void -hb_buffer_clear (hb_buffer_t *buffer); - void hb_buffer_clear_positions (hb_buffer_t *buffer); diff --git a/test/test-buffer.c b/test/test-buffer.c index d4c924349..4316f171c 100644 --- a/test/test-buffer.c +++ b/test/test-buffer.c @@ -146,10 +146,6 @@ test_buffer_contents (Fixture *fixture, gconstpointer user_data) g_assert_cmphex (glyphs[i].var1.u32, ==, 0); g_assert_cmphex (glyphs[i].var2.u32, ==, 0); } - - hb_buffer_clear (fixture->b); - /* XXX Make sure clear() doesn't unset other properties? */ - g_assert_cmpint (hb_buffer_get_length (fixture->b), ==, 0); } static void