You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2021/07/26 22:05:26 UTC

[GitHub] [trafficserver] SolidWallOfCode commented on a change in pull request #8095: Clean up Machine implementation for issue #4159.

SolidWallOfCode commented on a change in pull request #8095:
URL: https://github.com/apache/trafficserver/pull/8095#discussion_r676975804



##########
File path: iocore/utils/I_Machine.h
##########
@@ -77,22 +71,22 @@ struct Machine {
       @note This must be called before called @c instance so that the
       singleton is not @em inadvertently default initialized.
   */
-  static self *init(char const *name     = nullptr, ///< Host name of the machine.
-                    sockaddr const *addr = nullptr  ///< Primary IP address of the machine.
+  static self_type *init(char const *name     = nullptr, ///< Host name of the machine.
+                         sockaddr const *addr = nullptr  ///< Primary IP address of the machine.
   );
   /// @return The global instance of this class.
-  static self *instance();
-  bool is_self(const char *name);
-  bool is_self(const char *name, int name_len);
-  bool is_self(const IpAddr *ipaddr);
+  static self_type *instance();
+  bool is_self(std::string_view name);
+  bool is_self(std::string const &name);

Review comment:
       Unfortunately not - because the internal table is keyed by `std::string` it's more efficient to have an explicit overload for that type to avoid duplicating the original string.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org