Replace members by getters
Abierto
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 1.7k
- Forks
- 408
- Merge medio
- 2 d 57 min
- PR fusionados (30 d)
- 7
Descripción
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)\
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con las definiciones de MEMBER y RMEMBER en src/utils.h y, a continuación, inspecciona sus usos en src/diff.c, src/note.c y src/reference.c. Sustituye los miembros indicados por getters, preservando los atributos documentados y evitando la creación de objetos no utilizados; verifica que los bindings afectados se comporten de forma coherente.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- c, python
- Área
- devtools
- Tipo de issue
- Refactorización
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100