From bbdb6edb3e1cea4c5b7076c4f6b3e6998ae36dae Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 24 Nov 2018 17:15:38 -0500 Subject: [PATCH] [sanitize] Remove now-unused set_object() machinery --- src/hb-machinery.hh | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/src/hb-machinery.hh b/src/hb-machinery.hh index edef54053..9ca247d90 100644 --- a/src/hb-machinery.hh +++ b/src/hb-machinery.hh @@ -259,34 +259,11 @@ struct hb_sanitize_context_t : inline void set_max_ops (int max_ops_) { max_ops = max_ops_; } - template - inline void set_object (const T& obj) - { - reset_object (); - - const char *obj_start = (const char *) &obj; - const char *obj_end = (const char *) &obj + obj.get_size (); - assert (obj_start <= obj_end); /* Must not overflow. */ - - if (unlikely (obj_end < this->start || this->end < obj_start)) - this->start = this->end = nullptr; - else - { - this->start = MAX (this->start, obj_start); - this->end = MIN (this->end , obj_end ); - } - } - - inline void reset_object (void) + inline void start_processing (void) { this->start = this->blob->data; this->end = this->start + this->blob->length; assert (this->start <= this->end); /* Must not overflow. */ - } - - inline void start_processing (void) - { - reset_object (); this->max_ops = MAX ((unsigned int) (this->end - this->start) * HB_SANITIZE_MAX_OPS_FACTOR, (unsigned) HB_SANITIZE_MAX_OPS_MIN); this->edit_count = 0;