From d98d603e374a65c4f6aba8260e218225074e299f Mon Sep 17 00:00:00 2001 From: Twice Date: Tue, 27 Aug 2024 01:42:19 +0800 Subject: [PATCH] Fix code example of `for_each_prefix_of` in comment (#53) --- include/tsl/htrie_map.h | 12 ++++++------ include/tsl/htrie_set.h | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/tsl/htrie_map.h b/include/tsl/htrie_map.h index 51cf8b1..4aa4cb1 100644 --- a/include/tsl/htrie_map.h +++ b/include/tsl/htrie_map.h @@ -561,16 +561,16 @@ class htrie_map { * Example: * * tsl::htrie_map map = {{"/foo", 1}, {"/foo/bar", 2}}; - * auto print = [](tsl::htrie_map::iterator it) { + * auto print = [](tsl::htrie_map::iterator it) { * std::cout << it.key() << "\n"; * }; * * map.for_each_prefix_of("/foo", print); // prints "/foo" - * map.for_each_prefix_of("/foo/baz"); // prints nothing - * map.for_each_prefix_of("/foo/bar/baz"); // prints nothing - * map.for_each_prefix_of("/foo/bar/"); // prints "/foo" and "/foo/bar" - * map.for_each_prefix_of("/bar"); // prints nothing - * map.for_each_prefix_of(""); // prints nothing + * map.for_each_prefix_of("/foo/baz", print); // prints "/foo" + * map.for_each_prefix_of("/foo/bar/baz", print); // prints "/foo" and "/foo/bar" + * map.for_each_prefix_of("/foo/bar/", print); // prints "/foo" and "/foo/bar" + * map.for_each_prefix_of("/bar", print); // prints nothing + * map.for_each_prefix_of("", print); // prints nothing */ template void for_each_prefix_of_ks(const CharT* key, size_type key_size, diff --git a/include/tsl/htrie_set.h b/include/tsl/htrie_set.h index 0ec30cd..77a92db 100644 --- a/include/tsl/htrie_set.h +++ b/include/tsl/htrie_set.h @@ -488,11 +488,11 @@ class htrie_set { * }; * * set.for_each_prefix_of("/foo", print); // prints "/foo" - * set.for_each_prefix_of("/foo/baz"); // prints nothing - * set.for_each_prefix_of("/foo/bar/baz"); // prints nothing - * set.for_each_prefix_of("/foo/bar/"); // prints "/foo" and "/foo/bar" - * set.for_each_prefix_of("/bar"); // prints nothing - * set.for_each_prefix_of(""); // prints nothing + * set.for_each_prefix_of("/foo/baz", print); // prints "/foo" + * set.for_each_prefix_of("/foo/bar/baz", print); // prints "/foo" and "/foo/bar" + * set.for_each_prefix_of("/foo/bar/", print); // prints "/foo" and "/foo/bar" + * set.for_each_prefix_of("/bar", print); // prints nothing + * set.for_each_prefix_of("", print); // prints nothing */ template void for_each_prefix_of_ks(const CharT* key, size_type key_size,