Skip to content

Commit 123093b

Browse files
Apply small suggestions from code review
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
1 parent 2285015 commit 123093b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/i18n/locales/zh-TW/tools.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/integrations/misc/read-partial-content.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export async function readPartialContent(filePath: string, maxChars: number): Pr
4747
encoding: "utf8",
4848
highWaterMark: 16 * 1024, // Smaller 16KB chunks for better control
4949
start: 0,
50-
end: Math.max(0, Math.min(maxChars * 2, maxChars + 1024 * 1024)), // Read at most 2x maxChars or maxChars + 1MB buffer
50+
end: Math.max(0, Math.min(maxChars * 2, maxChars + 1024 * 1024)), // Heuristic: read at most the lesser of (2x maxChars) or (maxChars + 1MB), but never less than 0, to balance memory use and ensure enough data for multi-byte chars
5151
})
5252

5353
let content = ""

0 commit comments

Comments
 (0)