[Bf-blender-cvs] [5b7f49edc4a] functions: comment in stringmap

Jacques Lucke noreply at git.blender.org
Thu Jul 11 17:15:52 CEST 2019


Commit: 5b7f49edc4a927f05e2498d24f0b8402c317d67e
Author: Jacques Lucke
Date:   Thu Jul 11 16:34:53 2019 +0200
Branches: functions
https://developer.blender.org/rB5b7f49edc4a927f05e2498d24f0b8402c317d67e

comment in stringmap

===================================================================

M	source/blender/blenlib/BLI_string_map.hpp

===================================================================

diff --git a/source/blender/blenlib/BLI_string_map.hpp b/source/blender/blenlib/BLI_string_map.hpp
index bac3698feb1..5b5ba0e9697 100644
--- a/source/blender/blenlib/BLI_string_map.hpp
+++ b/source/blender/blenlib/BLI_string_map.hpp
@@ -1,3 +1,29 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/** \file
+ * \ingroup bli
+ *
+ * This tries to solve the issue that a normal map with std::string as key might do many
+ * allocations when the keys are longer than 16 bytes (the usual small string optimization size).
+ *
+ * For now this still uses std::string, but having this abstraction in place will make it easier to
+ * make it more efficient later on. Also, even if we will never implement this optimization, having
+ * a special map with string keys can be quite handy. */
+
 #pragma once
 
 #include "BLI_small_map.hpp"



More information about the Bf-blender-cvs mailing list