From d59ff95f48886c3ba4c4d3a8d35daa9ba88f19b5 Mon Sep 17 00:00:00 2001 From: yoshinorin Date: Mon, 29 Apr 2024 00:03:05 +0900 Subject: [PATCH] perf(router): avoid calling `set` when the generated data unmodified --- lib/hexo/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/hexo/index.ts b/lib/hexo/index.ts index b9ca764dd4..bd6141ed49 100644 --- a/lib/hexo/index.ts +++ b/lib/hexo/index.ts @@ -626,7 +626,10 @@ class Hexo extends EventEmitter { const { data, layout } = generatorResult; if (!layout) { - route.set(path, data); + // @ts-ignore + if (data.modified == null || data.modified) { + route.set(path, data); + } return path; }