mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-10 05:02:54 +00:00
LibUnicode: Do not compare generated file contents before writing
This is now covered by unicode_data.cmake after the superbuild changes.
This commit is contained in:
parent
a466b78bf3
commit
c8dbcdb0bc
Notes:
sideshowbarker
2024-07-18 03:16:56 +09:00
Author: https://github.com/trflynn89
Commit: c8dbcdb0bc
Pull-request: https://github.com/SerenityOS/serenity/pull/10039
Reviewed-by: https://github.com/ADKaster
2 changed files with 4 additions and 28 deletions
|
@ -125,18 +125,6 @@ static constexpr auto s_desired_fields = Array {
|
|||
"simple_lowercase_mapping"sv,
|
||||
};
|
||||
|
||||
static void write_to_file_if_different(Core::File& file, StringView contents)
|
||||
{
|
||||
auto const current_contents = file.read_all();
|
||||
|
||||
if (StringView { current_contents.bytes() } == contents)
|
||||
return;
|
||||
|
||||
VERIFY(file.seek(0));
|
||||
VERIFY(file.truncate(0));
|
||||
VERIFY(file.write(contents));
|
||||
}
|
||||
|
||||
static Vector<u32> parse_code_point_list(StringView const& list)
|
||||
{
|
||||
Vector<u32> code_points;
|
||||
|
@ -578,7 +566,7 @@ Optional<Script> script_from_string(StringView const& script);
|
|||
}
|
||||
)~~~");
|
||||
|
||||
write_to_file_if_different(file, generator.as_string_view());
|
||||
file.write(generator.as_string_view());
|
||||
}
|
||||
|
||||
static void generate_unicode_data_implementation(Core::File& file, UnicodeData const& unicode_data)
|
||||
|
@ -861,7 +849,7 @@ Optional<@enum_title@> @enum_snake@_from_string(StringView const& @enum_snake@)
|
|||
}
|
||||
)~~~");
|
||||
|
||||
write_to_file_if_different(file, generator.as_string_view());
|
||||
file.write(generator.as_string_view());
|
||||
}
|
||||
|
||||
static Vector<u32> flatten_code_point_ranges(Vector<CodePointRange> const& code_points)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue