diff options
| author | Quentin Carbonneaux | 2015-03-04 18:00:49 -0500 |
|---|---|---|
| committer | Quentin Carbonneaux | 2015-03-04 18:00:49 -0500 |
| commit | dedc9f5d9228719c36405d74cc65ab545a1eecff (patch) | |
| tree | ac3a5f4872a7b736394827f8ed863b96f950e248 | |
| parent | 466098e10e8643c1764efd3f260e2000c3e51a58 (diff) | |
avoid one copy
| -rw-r--r-- | miniyacc.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -293,16 +293,16 @@ iclose(Item *i) void igoto(Item *i, Sym s) { - Term *t, t1; + Term *t, *t1; int n; i0.nt = 0; for (n=0, t=i->ts; n<i->nt; n++, t++) { if (t->rule->rhs[t->dot] != s) continue; - t1 = *t; - t1.dot++; - i0.ts[i0.nt++] = t1; + t1 = &i0.ts[i0.nt++]; + *t1 = *t; + t1->dot++; } qsort(i0.ts, i0.nt, sizeof i0.ts[0], tcmpv); } |
