From de395a3df236eb653db78b5b88a0178036f99ba0 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 24 May 2021 11:50:46 +0200 Subject: AK+Everywhere: Consolidate String::index_of() and String::find() We had two functions for doing mostly the same thing. Combine both of them into String::find() and use that everywhere. Also add some tests to cover basic behavior. --- Userland/Libraries/LibDiff/Hunks.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Userland/Libraries/LibDiff') diff --git a/Userland/Libraries/LibDiff/Hunks.cpp b/Userland/Libraries/LibDiff/Hunks.cpp index 9887693d61..6870dda028 100644 --- a/Userland/Libraries/LibDiff/Hunks.cpp +++ b/Userland/Libraries/LibDiff/Hunks.cpp @@ -82,7 +82,7 @@ HunkLocation parse_hunk_location(const String& location_line) size_t length { 0 }; }; auto parse_start_and_length_pair = [](const String& raw) { - auto index_of_separator = raw.index_of(",").value(); + auto index_of_separator = raw.find(',').value(); auto start = raw.substring(0, index_of_separator); auto length = raw.substring(index_of_separator + 1, raw.length() - index_of_separator - 1); auto res = StartAndLength { start.to_uint().value() - 1, length.to_uint().value() - 1 }; -- cgit v1.2.3