From: HyoungjooAhn Date: Fri, 26 Oct 2018 01:17:05 +0000 (+0900) Subject: [Filter/TFLite] make better the inefficient code X-Git-Tag: v0.0.3~171 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6e53ce70189747b541ca607a33c875ecd2a457b9;p=platform%2Fupstream%2Fnnstreamer.git [Filter/TFLite] make better the inefficient code get the length of vector before the iteration Signed-off-by: HyoungjooAhn --- diff --git a/gst/tensor_filter/tensor_filter_tensorflow_lite_core.cc b/gst/tensor_filter/tensor_filter_tensorflow_lite_core.cc index 0bbbdc3..79ea3a4 100644 --- a/gst/tensor_filter/tensor_filter_tensorflow_lite_core.cc +++ b/gst/tensor_filter/tensor_filter_tensorflow_lite_core.cc @@ -332,7 +332,8 @@ TFLiteCore::invoke (const GstTensorMemory * input, GstTensorMemory * output) } /** if it is not `nullptr`, tensorflow makes `free()` the memory itself. */ - for (int i = 0; i < tensors_idx.size (); ++i) { + int tensorSize = tensors_idx.size (); + for (int i = 0; i < tensorSize; ++i) { interpreter->tensor (tensors_idx[i])->data.raw = nullptr; }