[gnote] Remove sharp::string_contains



commit 8de7fd26cc54814919ab2b122e2c35e4ae066b18
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Wed Jan 15 22:59:29 2014 +0200

    Remove sharp::string_contains

 src/addins/bugzilla/bugzillapreferences.cpp |    5 ++---
 src/search.cpp                              |    2 +-
 src/sharp/string.cpp                        |    5 -----
 src/sharp/string.hpp                        |    1 -
 4 files changed, 3 insertions(+), 10 deletions(-)
---
diff --git a/src/addins/bugzilla/bugzillapreferences.cpp b/src/addins/bugzilla/bugzillapreferences.cpp
index 99eff4a..55c46e7 100644
--- a/src/addins/bugzilla/bugzillapreferences.cpp
+++ b/src/addins/bugzilla/bugzillapreferences.cpp
@@ -1,7 +1,7 @@
 /*
  * gnote
  *
- * Copyright (C) 2011,2013 Aurimas Cernius
+ * Copyright (C) 2011,2013-2014 Aurimas Cernius
  * Copyright (C) 2010 Debarshi Ray
  * Copyright (C) 2009 Hubert Figuiere
  *
@@ -211,8 +211,7 @@ namespace bugzilla {
     /** sanitize the hostname. Return false if nothing could be done */
     bool sanitize_hostname(std::string & hostname)
     {
-      if(sharp::string_contains(hostname, "/") 
-         || sharp::string_contains(hostname, ":")) {
+      if(hostname.find("/") != std::string::npos || hostname.find(":") != std::string::npos) {
         sharp::Uri uri(hostname);
         std::string new_host = uri.get_host();
         if(new_host.empty()) {
diff --git a/src/search.cpp b/src/search.cpp
index 3c66c7b..80b3959 100644
--- a/src/search.cpp
+++ b/src/search.cpp
@@ -103,7 +103,7 @@ namespace gnote {
 
     for(std::vector<std::string>::const_iterator iter = encoded_words.begin();
         iter != encoded_words.end(); ++iter) {
-      if (sharp::string_contains(note_text, *iter) ) {
+      if(note_text.find(*iter) != std::string::npos) {
         continue;
       }
       else {
diff --git a/src/sharp/string.cpp b/src/sharp/string.cpp
index c79216f..0bf7253 100644
--- a/src/sharp/string.cpp
+++ b/src/sharp/string.cpp
@@ -102,11 +102,6 @@ namespace sharp {
     return boost::trim_copy_if(source, boost::is_any_of(set_of_char));
   }
 
-  bool string_contains(const std::string & source, const std::string &search)
-  {
-    return string_index_of(source, search) != -1;
-  }
-
   int string_last_index_of(const std::string & source, const std::string & search)
   {
     if(search.empty()) {
diff --git a/src/sharp/string.hpp b/src/sharp/string.hpp
index 3e44f2d..9cf2a0d 100644
--- a/src/sharp/string.hpp
+++ b/src/sharp/string.hpp
@@ -66,7 +66,6 @@ namespace sharp {
   std::string string_trim(const std::string & source);
   std::string string_trim(const std::string & source, const char * set_of_char);
 
-  bool string_contains(const std::string & source, const std::string &);
   int string_index_of(const std::string & source, const std::string & with);
   int string_index_of(const std::string & source, const std::string & with, int);
   int string_last_index_of(const std::string & source, const std::string & with);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]