mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 05:49:53 +08:00
change the policy of resizing the buffer when highlighting
Signed-off-by: Le Tan <tamlokveer@gmail.com>
This commit is contained in:
parent
29609f0b65
commit
7d77002c53
@ -206,9 +206,9 @@ void HGMarkdownHighlighter::parseInternal()
|
||||
if (len == 0) {
|
||||
return;
|
||||
} else if (len >= capacity) {
|
||||
resizeBuffer(qMax(2 * capacity, len + 1));
|
||||
resizeBuffer(qMax(2 * capacity, len * 2));
|
||||
} else if (len < (capacity >> 2)) {
|
||||
resizeBuffer(qMax(capacity >> 1, len + 1));
|
||||
resizeBuffer(qMax(capacity >> 1, len * 2));
|
||||
}
|
||||
|
||||
memcpy(content, data, len);
|
||||
|
Loading…
x
Reference in New Issue
Block a user