pygit2 icon indicating copy to clipboard operation
pygit2 copied to clipboard

Replace members by getters

Open jdavid opened this issue 5 years ago • 0 comments

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)\

jdavid avatar Jan 27 '20 12:01 jdavid