mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 16:32:45 +00:00 
			
		
		
		
	AK: Make {String,FlyString}::is_one_of() const
Also, make the zero-argument variant private since it's not meant to be called by clients directly.
This commit is contained in:
		
							parent
							
								
									2b1517f215
								
							
						
					
					
						commit
						643464c455
					
				
					 2 changed files with 6 additions and 4 deletions
				
			
		|  | @ -89,9 +89,8 @@ public: | |||
| 
 | ||||
|     static void did_destroy_impl(Badge<StringImpl>, StringImpl&); | ||||
| 
 | ||||
|     bool is_one_of() { return false; } | ||||
|     template<typename T, typename... Rest> | ||||
|     bool is_one_of(const T& string, Rest... rest) | ||||
|     bool is_one_of(const T& string, Rest... rest) const | ||||
|     { | ||||
|         if (string == *this) | ||||
|             return true; | ||||
|  | @ -100,6 +99,8 @@ public: | |||
| 
 | ||||
| 
 | ||||
| private: | ||||
|     bool is_one_of() const { return false; } | ||||
| 
 | ||||
|     RefPtr<StringImpl> m_impl; | ||||
| }; | ||||
| 
 | ||||
|  |  | |||
|  | @ -224,9 +224,8 @@ public: | |||
| 
 | ||||
|     int replace(const String& needle, const String& replacement, bool all_occurences = false); | ||||
| 
 | ||||
|     bool is_one_of() { return false; } | ||||
|     template<typename T, typename... Rest> | ||||
|     bool is_one_of(const T& string, Rest... rest) | ||||
|     bool is_one_of(const T& string, Rest... rest) const | ||||
|     { | ||||
|         if (string == *this) | ||||
|             return true; | ||||
|  | @ -234,6 +233,8 @@ public: | |||
|     } | ||||
| 
 | ||||
| private: | ||||
|     bool is_one_of() const { return false; } | ||||
| 
 | ||||
|     RefPtr<StringImpl> m_impl; | ||||
| }; | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling