From f2127456a8eb3e25fc54f39e129578677838f6a4 Mon Sep 17 00:00:00 2001 From: realstealthninja <68815218+realstealthninja@users.noreply.github.com> Date: Fri, 13 Sep 2024 15:39:46 +0530 Subject: [PATCH] chore: use iwyu on strings/**.cpp --- strings/boyer_moore.cpp | 13 +++++++------ strings/brute_force_string_searching.cpp | 9 +++++---- strings/horspool.cpp | 7 ++++--- strings/knuth_morris_pratt.cpp | 9 +++++---- strings/manacher_algorithm.cpp | 13 +++++++------ strings/rabin_karp.cpp | 10 +++++----- strings/z_function.cpp | 12 ++++++------ 7 files changed, 39 insertions(+), 34 deletions(-) diff --git a/strings/boyer_moore.cpp b/strings/boyer_moore.cpp index de79008e3..865969e66 100644 --- a/strings/boyer_moore.cpp +++ b/strings/boyer_moore.cpp @@ -42,12 +42,13 @@ * @author [Stoycho Kyosev](https://github.com/stoychoX) */ -#include /// for assert -#include /// for CHAR_MAX macro -#include /// for strlen -#include /// for IO operations -#include /// for std::string -#include /// for std::vector +#include // for assert +#include // for CHAR_MAX +#include // for size_t, strlen +#include // for operator<<, basic_ostream, cout +#include // for basic_string, string +#include // for vector +#include // for max #define APLHABET_SIZE CHAR_MAX ///< number of symbols in the alphabet we use diff --git a/strings/brute_force_string_searching.cpp b/strings/brute_force_string_searching.cpp index f908d83bc..9051e83ad 100644 --- a/strings/brute_force_string_searching.cpp +++ b/strings/brute_force_string_searching.cpp @@ -2,13 +2,14 @@ * @file * @brief String pattern search - brute force */ -#include +#include // for operator<<, basic_ostream, char_traits, cout +#include // for basic_string, operator==, string, to_string #ifdef _MSC_VER -#include // use this for MS Visual C++ +#include // for basic_string, operator==, string, to_string #else -#include +#include // for size_t #endif -#include +#include // for vector, allocator namespace string_search { /** diff --git a/strings/horspool.cpp b/strings/horspool.cpp index a43be5f0d..c409f5310 100644 --- a/strings/horspool.cpp +++ b/strings/horspool.cpp @@ -4,9 +4,10 @@ * @author [Harry Kontakis](https://github.com/ckontakis) */ -#include -#include -#include +#include // for unordered_map, _Node_iterator_base, operator!= +#include // for assert +#include // for basic_string, string +#include // for pair, make_pair /** * @namespace strings diff --git a/strings/knuth_morris_pratt.cpp b/strings/knuth_morris_pratt.cpp index e266d2c17..084a5044a 100644 --- a/strings/knuth_morris_pratt.cpp +++ b/strings/knuth_morris_pratt.cpp @@ -13,10 +13,11 @@ * @author [Yancey](https://github.com/Yancey2023) */ -#include /// for assert -#include /// for IO operations -#include /// for std::string -#include /// for std::vector +#include // for assert +#include // for size_t +#include // for operator<<, basic_ostream, cout +#include // for basic_string, string +#include // for vector /** * @namespace string_search diff --git a/strings/manacher_algorithm.cpp b/strings/manacher_algorithm.cpp index 1c1581a33..1349caabe 100644 --- a/strings/manacher_algorithm.cpp +++ b/strings/manacher_algorithm.cpp @@ -10,14 +10,15 @@ * @author [Riti Kumari](https://github.com/riti2409) */ -#include /// for assert -#include /// for integral typedefs -#include /// for IO operations -#include /// for std::vector STL +#include // for assert +#include // for uint64_t +#include // for char_traits, basic_ostream, operator<<, cout, endl +#include // for allocator, vector +#include // for min +#include // for basic_string, operator==, operator+, string #ifdef _MSC_VER -#include /// for string (required for MS Visual C++) +#include // for basic_string, operator==, operator+, string #else -#include /// for string #endif /** diff --git a/strings/rabin_karp.cpp b/strings/rabin_karp.cpp index 91e104188..27d57a96c 100644 --- a/strings/rabin_karp.cpp +++ b/strings/rabin_karp.cpp @@ -4,13 +4,13 @@ * Algorithm](https://en.wikipedia.org/wiki/Rabin–Karp_algorithm) for finding a * pattern within a piece of text with complexity O(n + m) */ -#include -#include -#include +#include // for int64_t +#include // for assert +#include // for pow +#include // for basic_string, string #ifdef _MSC_VER -#include // use this for MS Visucal C++ +#include // for basic_string, string #else -#include #endif #define PRIME 5 ///< Prime modulus for hash functions diff --git a/strings/z_function.cpp b/strings/z_function.cpp index 25a5755a7..b22197b19 100644 --- a/strings/z_function.cpp +++ b/strings/z_function.cpp @@ -11,15 +11,15 @@ * @author [Ritika Gupta](https://github.com/RitikaGupta8734) */ -#include /// for integral typedefs -#include /// for IO operations +#include // for uint64_t +#include // for min +#include // for basic_string, string, operator+, char_traits #ifdef _MSC_VER -#include /// for string (use this for MS Visual C++) +#include // for basic_string, string, operator+, char_traits #else -#include /// for string #endif -#include /// for assert -#include /// for std::vector +#include // for assert +#include // for vector, allocator, operator== /** * @brief Generate the Z-function for the inputted string.