aboutsummaryrefslogtreecommitdiff
path: root/vis-core.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-01-31 14:05:18 +0100
committerMarc André Tanner <mat@brain-dump.org>2017-01-31 14:05:18 +0100
commit8a419b7d67feaa587fe0b0b9c3d0521389a4d5ef (patch)
tree1386ca524834dbcc386feb210d3ed097ffb91324 /vis-core.h
parent963c238ff8d3f734bd852669d379e951f4fc7649 (diff)
downloadvis-8a419b7d67feaa587fe0b0b9c3d0521389a4d5ef.tar.gz
vis-8a419b7d67feaa587fe0b0b9c3d0521389a4d5ef.tar.xz
sam: optmize transcript insertion for common case
This esentially performs an insertion sort. Rather than iterating the list from the start every time keep track of the latest change and optmize for monotonically increasing file positions.
Diffstat (limited to 'vis-core.h')
-rw-r--r--vis-core.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/vis-core.h b/vis-core.h
index 66c71c4..a1039a8 100644
--- a/vis-core.h
+++ b/vis-core.h
@@ -110,6 +110,7 @@ typedef struct { /** collects all information until an operator is e
typedef struct Change Change;
typedef struct {
Change *changes; /* all changes in monotonically increasing file position */
+ Change *latest; /* most recent change */
enum SamError error; /* non-zero in case something went wrong */
} Transcript;