[Bf-blender-cvs] [19d4e265b65] master: Cleanup: remove redundant comments

Jacques Lucke noreply at git.blender.org
Tue Jul 7 10:36:52 CEST 2020


Commit: 19d4e265b655982945464a6bc24b093e86e9b84b
Author: Jacques Lucke
Date:   Tue Jul 7 10:35:28 2020 +0200
Branches: master
https://developer.blender.org/rB19d4e265b655982945464a6bc24b093e86e9b84b

Cleanup: remove redundant comments

Searching in these files for "_as" will reveal a comment at the
top, that explains what these methods are for. There is no need
to duplicate that knowledge all over the place.

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

M	source/blender/blenlib/BLI_map.hh
M	source/blender/blenlib/BLI_set.hh
M	source/blender/blenlib/BLI_vector_set.hh

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

diff --git a/source/blender/blenlib/BLI_map.hh b/source/blender/blenlib/BLI_map.hh
index 0a044afe8af..ab13305db6d 100644
--- a/source/blender/blenlib/BLI_map.hh
+++ b/source/blender/blenlib/BLI_map.hh
@@ -271,10 +271,6 @@ class Map {
   {
     return this->add_as(std::move(key), std::move(value));
   }
-
-  /**
-   * Same as `add`, but accepts other key types that are supported by the hash function.
-   */
   template<typename ForwardKey, typename ForwardValue>
   bool add_as(ForwardKey &&key, ForwardValue &&value)
   {
@@ -305,10 +301,6 @@ class Map {
   {
     return this->add_overwrite_as(std::move(key), std::move(value));
   }
-
-  /**
-   * Same as `add_overwrite`, but accepts other key types that are supported by the hash function.
-   */
   template<typename ForwardKey, typename ForwardValue>
   bool add_overwrite_as(ForwardKey &&key, ForwardValue &&value)
   {
@@ -325,10 +317,6 @@ class Map {
   {
     return this->contains_as(key);
   }
-
-  /**
-   * Same as `contains`, but accepts other key types that are supported by the hash function.
-   */
   template<typename ForwardKey> bool contains_as(const ForwardKey &key) const
   {
     return this->contains__impl(key, hash_(key));
@@ -344,10 +332,6 @@ class Map {
   {
     return this->remove_as(key);
   }
-
-  /**
-   * Same as `remove`, but accepts other key types that are supported by the hash function.
-   */
   template<typename ForwardKey> bool remove_as(const ForwardKey &key)
   {
     return this->remove__impl(key, hash_(key));
@@ -361,11 +345,6 @@ class Map {
   {
     this->remove_contained_as(key);
   }
-
-  /**
-   * Same as `remove_contained`, but accepts other key types that are supported by the hash
-   * function.
-   */
   template<typename ForwardKey> void remove_contained_as(const ForwardKey &key)
   {
     this->remove_contained__impl(key, hash_(key));
@@ -379,10 +358,6 @@ class Map {
   {
     return this->pop_as(key);
   }
-
-  /**
-   * Same as `pop`, but accepts other key types that are supported by the hash function.
-   */
   template<typename ForwardKey> Value pop_as(const ForwardKey &key)
   {
     return this->pop__impl(key, hash_(key));
@@ -396,10 +371,6 @@ class Map {
   {
     return this->pop_try_as(key);
   }
-
-  /**
-   * Same as `pop_try`, but accepts other key types that are supported by the hash function.
-   */
   template<typename ForwardKey> std::optional<Value> pop_try_as(const ForwardKey &key)
   {
     return this->pop_try__impl(key, hash_(key));
@@ -417,10 +388,6 @@ class Map {
   {
     return this->pop_default_as(key, std::move(default_value));
   }
-
-  /**
-   * Same as `pop_default`, but accepts other key types that are supported by the hash function.
-   */
   template<typename ForwardKey, typename ForwardValue>
   Value pop_default_as(const ForwardKey &key, ForwardValue &&default_value)
   {
@@ -460,10 +427,6 @@ class Map {
   {
     return this->add_or_modify_as(std::move(key), create_value, modify_value);
   }
-
-  /**
-   * Same as `add_or_modify`, but accepts other key types that are supported by the hash function.
-   */
   template<typename ForwardKey, typename CreateValueF, typename ModifyValueF>
   auto add_or_modify_as(ForwardKey &&key,
                         const CreateValueF &create_value,
@@ -487,10 +450,6 @@ class Map {
   {
     return this->lookup_ptr_as(key);
   }
-
-  /**
-   * Same as `lookup_ptr`, but accepts other key types that are supported by the hash function.
-   */
   template<typename ForwardKey> const Value *lookup_ptr_as(const ForwardKey &key) const
   {
     return this->lookup_ptr__impl(key, hash_(key));
@@ -512,10 +471,6 @@ class Map {
   {
     return this->lookup_as(key);
   }
-
-  /**
-   * Same as `lookup`, but accepts other key types that are supported by the hash function.
-   */
   template<typename ForwardKey> const Value &lookup_as(const ForwardKey &key) const
   {
     const Value *ptr = this->lookup_ptr_as(key);
@@ -537,10 +492,6 @@ class Map {
   {
     return this->lookup_default_as(key, default_value);
   }
-
-  /**
-   * Same as `lookup_default`, but accepts other key types that are supported by the hash function.
-   */
   template<typename ForwardKey, typename ForwardValue>
   Value lookup_default_as(const ForwardKey &key, ForwardValue &&default_value) const
   {
@@ -573,11 +524,6 @@ class Map {
   {
     return this->lookup_or_add_as(std::move(key), std::move(value));
   }
-
-  /**
-   * Same as `lookup_or_add`, but accepts other key types that are supported by the hash
-   * function.
-   */
   template<typename ForwardKey, typename ForwardValue>
   Value &lookup_or_add_as(ForwardKey &&key, ForwardValue &&value)
   {
@@ -602,11 +548,6 @@ class Map {
   {
     return this->lookup_or_add_cb_as(std::move(key), create_value);
   }
-
-  /**
-   * Same as `lookup_or_add_cb`, but accepts other key types that are supported by the hash
-   * function.
-   */
   template<typename ForwardKey, typename CreateValueF>
   Value &lookup_or_add_cb_as(ForwardKey &&key, const CreateValueF &create_value)
   {
@@ -625,11 +566,6 @@ class Map {
   {
     return this->lookup_or_add_default_as(std::move(key));
   }
-
-  /**
-   * Same as `lookup_or_add_default`, but accepts other key types that are supported by the hash
-   * function.
-   */
   template<typename ForwardKey> Value &lookup_or_add_default_as(ForwardKey &&key)
   {
     return this->lookup_or_add_cb_as(std::forward<ForwardKey>(key), []() { return Value(); });
diff --git a/source/blender/blenlib/BLI_set.hh b/source/blender/blenlib/BLI_set.hh
index bf981154da4..c5096f84c80 100644
--- a/source/blender/blenlib/BLI_set.hh
+++ b/source/blender/blenlib/BLI_set.hh
@@ -260,10 +260,6 @@ class Set {
   {
     return this->add_as(std::move(key));
   }
-
-  /**
-   * Same as `add`, but accepts other key types that are supported by the hash function.
-   */
   template<typename ForwardKey> bool add_as(ForwardKey &&key)
   {
     return this->add__impl(std::forward<ForwardKey>(key), hash_(key));
@@ -303,10 +299,6 @@ class Set {
   {
     return this->contains_as(key);
   }
-
-  /**
-   * Same as `contains`, but accepts other key types that are supported by the hash function.
-   */
   template<typename ForwardKey> bool contains_as(const ForwardKey &key) const
   {
     return this->contains__impl(key, hash_(key));
@@ -320,10 +312,6 @@ class Set {
   {
     return this->lookup_key_as(key);
   }
-
-  /**
-   * Same as `lookup_key`, but accepts other key types that are supported by the hash function.
-   */
   template<typename ForwardKey> const Key &lookup_key_as(const ForwardKey &key) const
   {
     return this->lookup_key__impl(key, hash_(key));
@@ -337,11 +325,6 @@ class Set {
   {
     return this->lookup_key_default_as(key, default_value);
   }
-
-  /**
-   * Same as `lookup_key_default`, but accepts other key types that are supported by the hash
-   * function.
-   */
   template<typename ForwardKey>
   const Key &lookup_key_default_as(const ForwardKey &key, const Key &default_key) const
   {
@@ -360,11 +343,6 @@ class Set {
   {
     return this->lookup_key_ptr_as(key);
   }
-
-  /**
-   * Same as `lookup_key_ptr`, but accepts other key types that are supported by the hash
-   * function.
-   */
   template<typename ForwardKey> const Key *lookup_key_ptr_as(const ForwardKey &key) const
   {
     return this->lookup_key_ptr__impl(key, hash_(key));
@@ -379,10 +357,6 @@ class Set {
   {
     return this->remove_as(key);
   }
-
-  /**
-   * Same as `remove`, but accepts other key types that are supported by the hash function.
-   */
   template<typename ForwardKey> bool remove_as(const ForwardKey &key)
   {
     return this->remove__impl(key, hash_(key));
@@ -395,11 +369,6 @@ class Set {
   {
     this->remove_contained_as(key);
   }
-
-  /**
-   * Same as `remove_contained`, but accepts other key types that are supported by the hash
-   * function.
-   */
   template<typename ForwardKey> void remove_contained_as(const ForwardKey &key)
   {
     this->remove_contained__impl(key, hash_(key));
diff --git a/source/blender/blenlib/BLI_vector_set.hh b/source/blender/blenlib/BLI_vector_set.hh
index a39f6a97f70..dd1b17653c0 100644
--- a/source/blender/blenlib/BLI_vector_set.hh
+++ b/source/blender/blenlib/BLI_vector_set.hh
@@ -288,10 +288,6 @@ class VectorSet {
   {
     return this->add_as(std::move(key));
   }
-
-  /**
-   * Same as `add`, but accepts other key types that are supported by the hash function.
-   */
   template<typename ForwardKey> bool add_as(ForwardKey &&key)
   {
     return this->add__impl(std::forward<ForwardKey>(key), hash_(key));
@@ -320,10 +316,6 @@ class VectorSet {
   {
     return this->contains_as(key);
   }
-
-  /**
-   * Same as `contains`, but accepts other key types that are supported by the hash function.
-   */
   template<typename ForwardKey> bool contains_as(const ForwardKey &key) const
   {
     return this->contains__impl(key, hash_(key));
@@ -339,10 +331,6 @@ class VectorSet {
   {
     return this->remove_as(key);
   }
-
-  /**
-   * Same as `remove`, but accepts other key types that are supported by the hash function.
-   */
   template<typename ForwardKey> bool remove_as(const ForwardKey &key)
   {
     return this->remove__impl(key, hash_(key));
@@ -356,11 +344,6 @@ class VectorSet {
   {
     this->remove_contained_as(key);
   }
-
-  /**
-   * Same as `remove_contained`, but accepts other key types that are supported by the hash
-   * function.
-   */
   template<typename ForwardKey> void remove_contained_as(const ForwardKey &key)
   {
     this->remove_contained__impl(key, hash_(key));
@@ -383,10 +366,6 @@ class VectorSet {
   {
     return this->index_of_as(key);
   }
-
-  /**
-   * Same as `index_of`, but accepts other key types that are supported by the hash function.
-   */
   template<typename ForwardKey> uint32_t index_of_as(const ForwardKey &key) const
   {
     return this->index_of__impl(key, hash_(key));
@@ -400,10 +379,6 @@ class VectorSet {
   {
     return (int32_t)this->index_of_try_as(key);
   }
-
-  /**
-   * Same as `index_of_try`, but accepts other key types that are supported by the hash function.
-   */
   template<typename ForwardKey> int32_t index_of_try_as(const ForwardKey &key) const
   {
     re

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list