From 65879b17434eb90663e54b854e8310084b46b3c1 Mon Sep 17 00:00:00 2001 From: Alexey Date: Fri, 5 Jun 2020 16:40:17 +0300 Subject: [PATCH] undo: micro optim --- atsynedit/atstrings.pas | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/atsynedit/atstrings.pas b/atsynedit/atstrings.pas index e57fac8ce..0067eb10b 100644 --- a/atsynedit/atstrings.pas +++ b/atsynedit/atstrings.pas @@ -1640,8 +1640,13 @@ procedure TATStrings.DoUndoSingle(ACurList: TATUndoList; ASoftMarked:= Item.ItemSoftMark; AHardMarked:= Item.ItemHardMark; NCount:= ACurList.Count; - AHardMarkedNext:= (NCount>1) and (ACurList[NCount-2].ItemHardMark); - AUnmodifiedNext:= (NCount>1) and (ACurList[NCount-2].ItemAction=aeaClearModified); + + if NCount>1 then + with ACurList[NCount-2] do + begin + AHardMarkedNext:= ItemHardMark; + AUnmodifiedNext:= ItemAction=aeaClearModified; + end; //don't undo if one item left: unmodified-mark if ACurList.IsEmpty then exit;