Skip to content

Commit 486cc6c

Browse files
committed
Drop unnecessary string copy
1 parent a58b1f7 commit 486cc6c

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/java_symbols.hpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -699,11 +699,9 @@ inline std::string remove_jpms_requires(std::string_view content, std::span<cons
699699

700700
inline std::string handle_content(const Path_origin_entry& path, std::string_view content, const Parameters& parameters)
701701
{
702-
auto result = std::string();
703-
704702
if (path.filename() == "module-info.java")
705703
{
706-
result = remove_jpms_requires(content, parameters.module_patterns_);
704+
return remove_jpms_requires(content, parameters.module_patterns_);
707705
}
708706
else
709707
{
@@ -720,10 +718,8 @@ inline std::string handle_content(const Path_origin_entry& path, std::string_vie
720718
}
721719
}
722720

723-
result = new_content;
721+
return new_content;
724722
}
725-
726-
return result;
727723
}
728724

729725
inline std::string handle_file(const Path_origin_entry& path, const Parameters& parameters)

0 commit comments

Comments
 (0)