Skip to content

Commit

Permalink
bugfix and dead code elimination
Browse files Browse the repository at this point in the history
  • Loading branch information
krangelov committed Apr 5, 2024
1 parent d48a8d0 commit 6126d36
Showing 1 changed file with 1 addition and 33 deletions.
34 changes: 1 addition & 33 deletions src/runtime/c/pgf/phrasetable.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -309,39 +309,6 @@ int text_sequence_cmp(PgfTextSpot *spot, const uint8_t *end,
}
}

static
int backref_cmp(ref<PgfSequenceBackref> backref, ref<PgfConcrLincat> lincat, size_t r)
{
int cmp = 0;
switch (ref<PgfConcrLin>::get_tag(backref->container)) {
case PgfConcrLin::tag: {
ref<PgfConcrLin> lin = ref<PgfConcrLin>::untagged(backref->container);
if (lincat.as_object() < lin->lincat.as_object())
cmp = -1;
else if (lincat.as_object() > lin->lincat.as_object())
cmp = 1;
break;
}
case PgfConcrLincat::tag: {
if (lincat.as_object() > 0)
cmp = 1;
break;
}
}

if (cmp == 0) {
size_t r1 =
(lincat == 0) ? 0
: backref->seq_index % lincat->fields->len;
if (r < r1)
cmp = -1;
else if (r > r1)
cmp = 1;
}

return cmp;
}

PGF_INTERNAL_DECL
size_t get_next_padovan(size_t min);

Expand Down Expand Up @@ -465,6 +432,7 @@ PgfPhrasetable phrasetable_delete(PgfPhrasetable table,
if (n_backrefs > 1) {
ref<Vector<PgfSequenceBackref>> backrefs =
PgfDB::realloc<Vector<PgfSequenceBackref>>(table->value.backrefs,len*sizeof(PgfSequenceBackref),n_backrefs*sizeof(PgfSequenceBackref),table->txn_id);
backrefs->len = n_backrefs;
size_t i = 0;
while (i < n_backrefs) {
ref<PgfSequenceBackref> backref =
Expand Down

0 comments on commit 6126d36

Please sign in to comment.