Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace members by getters #969

Open
jdavid opened this issue Jan 27, 2020 · 0 comments
Open

Replace members by getters #969

jdavid opened this issue Jan 27, 2020 · 0 comments

Comments

@jdavid
Copy link
Member

jdavid commented Jan 27, 2020

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)\
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant