antirez / antirez/kilo

Small nit

Offen
#15 2 Kommentare 3 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C
Sterne
9.1k
Forks
997
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hey there, I don't really want to make a pull request here so I thought I'd just make an issue. Sorry if that's not proper etiquette! By the way, love the work.
The following lines of code appear in the source code:

``` c
erow *row = (filerow >= E.numrows) ? NULL : &E.row[filerow];
if (row) {
for (j = E.coloff; j < (E.cx+E.coloff); j++) {
if (j < row->size && row->chars[j] == TAB) cx += 7-((cx)%8);
cx++;
}
}
```

Surely this should be simplified slightly to:

``` c
if (filerow < E.numrows) {
erow *row = &E.row[filerow];
for (j = E.coloff; j < (E.cx+E.coloff); j++) {
if (j < row->size && row->chars[j] == TAB) cx += 7-((cx)%8);
cx++;
}
}
```

It seems a little off to make the conditional based off of the result of another conditional that appears literally one line above.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.