From a482fa0a8018df1dde9252ce283a1fd27f7029b9 Mon Sep 17 00:00:00 2001 From: frank <420@shampoo.ooo> Date: Tue, 29 Jun 2021 17:17:50 -0400 Subject: [PATCH] remove reserve call on item vector --- config.json | 2 +- lib/sfw | 2 +- src/Item.cpp | 13 ------------- src/Item.hpp | 2 -- src/Pudding.cpp | 1 - src/Pudding.hpp | 1 - 6 files changed, 2 insertions(+), 19 deletions(-) diff --git a/config.json b/config.json index d411d4c..a1d32d1 100644 --- a/config.json +++ b/config.json @@ -37,7 +37,7 @@ { "json-save": true, "json-save-directory": "local/scans", - "barcode": "", + "barcode": "1703543090000", "capture-device": "/dev/video0" }, "api": diff --git a/lib/sfw b/lib/sfw index 95a1e6b..17adaed 160000 --- a/lib/sfw +++ b/lib/sfw @@ -1 +1 @@ -Subproject commit 95a1e6b5b126af2541c7ea0d0e978f021cea2018 +Subproject commit 17adaed169c40536cb9b25425c64712b1d0f74d1 diff --git a/src/Item.cpp b/src/Item.cpp index 76a80c8..042237d 100644 --- a/src/Item.cpp +++ b/src/Item.cpp @@ -27,12 +27,6 @@ void Item::add_image_texture(std::shared_ptr texture) image_textures.push_back(texture); } -void Item::destroy_texture(SDL_Texture* texture) -{ - SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "destroying texture %p", texture); - SDL_DestroyTexture(texture); -} - const std::vector>& Item::get_image_textures() const { return image_textures; @@ -88,10 +82,3 @@ void Item::increment_image_index(int increment) { current_image_index = sfw::mod(current_image_index + increment, static_cast(get_image_textures().size())); } - -Item::~Item() -{ - std::stringstream message; - message << "destroying item " << this; - debug(message.str()); -} diff --git a/src/Item.hpp b/src/Item.hpp index 1c01a8c..f3526d2 100644 --- a/src/Item.hpp +++ b/src/Item.hpp @@ -19,7 +19,6 @@ private: std::string brand_name = "", product_name = "", upc = ""; int current_image_index = 0; void set_text_property(const std::string&, std::string&, const std::string&); - static void destroy_texture(SDL_Texture*); /* * add properties: ingredients, protein weight, nutrition grade, popularity, "serving unit", keywords, @@ -40,7 +39,6 @@ public: const std::string& get_upc() const; std::string get_full_name() const; void increment_image_index(int = 1); - virtual ~Item(); }; diff --git a/src/Pudding.cpp b/src/Pudding.cpp index 41bf92f..4b6ddc4 100644 --- a/src/Pudding.cpp +++ b/src/Pudding.cpp @@ -49,7 +49,6 @@ Pudding::Pudding() image_scanner.set_config(zbar::ZBAR_NONE, zbar::ZBAR_CFG_ENABLE, 1); /* use sdl context for now */ load_sdl_context(); - items.reserve(10); } /* Respond to command events */ diff --git a/src/Pudding.hpp b/src/Pudding.hpp index 70cbc1b..f721698 100644 --- a/src/Pudding.hpp +++ b/src/Pudding.hpp @@ -17,7 +17,6 @@ #include "opencv2/imgproc.hpp" #include "zbar.h" #include "Game.hpp" -#include "Sprite.hpp" #include "Color.hpp" #include "extension.hpp" #include "Item.hpp"