Improve performance, fix file write bug, update headers
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
// AUTOGENERATED COPYRIGHT HEADER START
|
||||||
|
// Copyright (C) 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
||||||
|
// AUTOGENERATED COPYRIGHT HEADER END
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
// AUTOGENERATED COPYRIGHT HEADER START
|
||||||
|
// Copyright (C) 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
||||||
|
// AUTOGENERATED COPYRIGHT HEADER END
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# AUTOGENERATED COPYRIGHT HEADER START
|
# AUTOGENERATED COPYRIGHT HEADER START
|
||||||
# Copyright (C) NaN-NaN undefined
|
|
||||||
# Copyright (C) 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
# Copyright (C) 2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
||||||
# AUTOGENERATED COPYRIGHT HEADER END
|
# AUTOGENERATED COPYRIGHT HEADER END
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
; AUTOGENERATED COPYRIGHT HEADER START
|
; AUTOGENERATED COPYRIGHT HEADER START
|
||||||
; Copyright (C) 2017 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
; Copyright (C) 2017-2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
||||||
; AUTOGENERATED COPYRIGHT HEADER END
|
; AUTOGENERATED COPYRIGHT HEADER END
|
||||||
; Ein simpler Lexer Test
|
; Ein simpler Lexer Test
|
||||||
Local Variable = 1.0
|
Local Variable = 1.0
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
; AUTOGENERATED COPYRIGHT HEADER START
|
; AUTOGENERATED COPYRIGHT HEADER START
|
||||||
; Copyright (C) 2017 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
; Copyright (C) 2017-2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
||||||
; AUTOGENERATED COPYRIGHT HEADER END
|
; AUTOGENERATED COPYRIGHT HEADER END
|
||||||
Graphics 800,600,32,2
|
Graphics 800,600,32,2
|
||||||
SetBuffer BackBuffer()
|
SetBuffer BackBuffer()
|
||||||
|
|||||||
+6
-8
@@ -194,7 +194,7 @@ class RateLimiter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let abortAllWork = false;
|
let abortAllWork = false;
|
||||||
let gitRL = new RateLimiter(3);
|
let gitRL = new RateLimiter(2);
|
||||||
let workRL = new RateLimiter();
|
let workRL = new RateLimiter();
|
||||||
let gitCurrentFiles;
|
let gitCurrentFiles;
|
||||||
let gitUserName;
|
let gitUserName;
|
||||||
@@ -496,7 +496,6 @@ async function updateFile(file) {
|
|||||||
//startHeader = contentBuf.lastIndexOf(eolBuf, startHeader);
|
//startHeader = contentBuf.lastIndexOf(eolBuf, startHeader);
|
||||||
//startHeader += eolb.byteLength;
|
//startHeader += eolb.byteLength;
|
||||||
}
|
}
|
||||||
console.log(sectionStart, startHeader);
|
|
||||||
|
|
||||||
// Find the ending point.
|
// Find the ending point.
|
||||||
let endHeader = contentBuf.lastIndexOf(Buffer.from(header[header.length - 1], "utf8"));
|
let endHeader = contentBuf.lastIndexOf(Buffer.from(header[header.length - 1], "utf8"));
|
||||||
@@ -504,7 +503,6 @@ async function updateFile(file) {
|
|||||||
endHeader += Buffer.from(header[header.length - 1], "utf8").byteLength;
|
endHeader += Buffer.from(header[header.length - 1], "utf8").byteLength;
|
||||||
endHeader += Buffer.byteLength(eol, "utf8");
|
endHeader += Buffer.byteLength(eol, "utf8");
|
||||||
}
|
}
|
||||||
console.log(sectionEnd, endHeader);
|
|
||||||
|
|
||||||
// Last check for early-exit here.
|
// Last check for early-exit here.
|
||||||
if (abortAllWork) {
|
if (abortAllWork) {
|
||||||
@@ -513,17 +511,17 @@ async function updateFile(file) {
|
|||||||
|
|
||||||
let fd = await FSPROMISES.open(file, "w");
|
let fd = await FSPROMISES.open(file, "w");
|
||||||
if (startHeader == -1 || (endHeader < startHeader)) {
|
if (startHeader == -1 || (endHeader < startHeader)) {
|
||||||
fd.write(headerBuf, 0, null, 0);
|
await fd.write(headerBuf, 0, null, 0);
|
||||||
fd.write(contentBuf, 0, null, headerBuf.byteLength);
|
await fd.write(contentBuf, 0, null, headerBuf.byteLength);
|
||||||
} else {
|
} else {
|
||||||
let pos = 0;
|
let pos = 0;
|
||||||
|
|
||||||
if (startHeader > 0) {
|
if (startHeader > 0) {
|
||||||
fd.write(contentBuf, 0, startHeader - Buffer.byteLength(eol, "utf8").byteLength, 0);
|
await fd.write(contentBuf, 0, startHeader, 0);
|
||||||
pos += startHeader;
|
pos += startHeader;
|
||||||
}
|
}
|
||||||
fd.write(headerBuf, 0, null, pos); pos += headerBuf.byteLength;
|
await fd.write(headerBuf, 0, null, pos); pos += headerBuf.byteLength;
|
||||||
fd.write(contentBuf, endHeader, null, pos);
|
await fd.write(contentBuf, endHeader, null, pos);
|
||||||
}
|
}
|
||||||
await fd.close();
|
await fd.close();
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
|
|||||||
Reference in New Issue
Block a user