Skip to content

Commit c5f7e6e

Browse files
committed
perf(sitemap.xml): inline a method to avoid strings concatenations
1 parent 914cff9 commit c5f7e6e

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/main/java/ru/mystamps/web/feature/site/SitemapController.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,13 @@ public void generateSitemapXml(HttpServletResponse response) {
7878

7979
private static String createUrlEntry(DateFormat dateFormatter, SitemapInfoDto item) {
8080
return new StringBuilder("<url><loc>")
81-
.append(createLocEntry(item))
81+
.append(SiteUrl.PUBLIC_URL).append(SeriesUrl.INFO_SERIES_PAGE.replace("{id}", item.getId()))
8282
.append("</loc><lastmod>")
8383
.append(createLastModEntry(dateFormatter, item))
8484
.append("</lastmod></url>\n")
8585
.toString();
8686
}
8787

88-
private static String createLocEntry(SitemapInfoDto item) {
89-
return SiteUrl.PUBLIC_URL
90-
+ SeriesUrl.INFO_SERIES_PAGE.replace("{id}", item.getId());
91-
}
92-
9388
private static String createLastModEntry(DateFormat dateFormatter, SitemapInfoDto item) {
9489
return dateFormatter.format(item.getUpdatedAt());
9590
}

0 commit comments

Comments
 (0)