Replace members by getters
Offen
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 1.7k
- Forks
- 408
- Ø Merge
- 2 T. 57 Min.
- Gemergte PRs (30 T.)
- 7
Beschreibung
For consistency and better performance (not creating objects that may not be used).
$ grep MEMBER src/*
src/diff.c: MEMBER(DiffFile, id, T_OBJECT, "Oid of the item."),
src/diff.c: MEMBER(DiffFile, path, T_STRING, "Path to the entry."),
src/diff.c: MEMBER(DiffFile, raw_path, T_OBJECT, "Path to the entry (bytes)."),
src/diff.c: MEMBER(DiffFile, size, T_LONG, "Size of the entry."),
src/diff.c: MEMBER(DiffFile, flags, T_UINT, "Combination of GIT_DIFF_FLAG_* flags."),
src/diff.c: MEMBER(DiffFile, mode, T_USHORT, "Mode of the entry."),
src/diff.c: MEMBER(DiffDelta, status, T_UINT, "A GIT_DELTA_* constant."),
src/diff.c: MEMBER(DiffDelta, flags, T_UINT, "Combination of GIT_DIFF_FLAG_* flags."),
src/diff.c: MEMBER(DiffDelta, similarity, T_USHORT, "For renamed and copied."),
src/diff.c: MEMBER(DiffDelta, nfiles, T_USHORT, "Number of files in the delta."),
src/diff.c: MEMBER(DiffDelta, old_file, T_OBJECT, "\"from\" side of the diff."),
src/diff.c: MEMBER(DiffDelta, new_file, T_OBJECT, "\"to\" side of the diff."),
src/note.c: MEMBER(Note, id, T_OBJECT, "id of the note object."),
src/note.c: MEMBER(Note, annotated_id, T_OBJECT, "id of the annotated object."),
src/reference.c: MEMBER(RefLogEntry, oid_new, T_OBJECT, "New oid."),
src/reference.c: MEMBER(RefLogEntry, oid_old, T_OBJECT, "Old oid."),
src/reference.c: MEMBER(RefLogEntry, message, T_STRING, "Message."),
src/utils.h:#define MEMBER(type, attr, attr_type, docstr)\
src/utils.h:#define RMEMBER(type, attr, attr_type, docstr)\
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit den MEMBER- und RMEMBER-Definitionen in src/utils.h und untersuche anschließend deren Verwendung in src/diff.c, src/note.c und src/reference.c. Ersetze die aufgeführten Member durch Getter, wobei die dokumentierten Attribute erhalten bleiben und die Erstellung ungenutzter Objekte vermieden wird; überprüfe, dass sich die betroffenen Bindings konsistent verhalten.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- c, python
- Bereich
- devtools
- Issue-Typ
- Refactoring
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100