mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
refactor(reflog): use naming conventions for similar methods
This commit is contained in:
parent
5675f9265c
commit
c26e3f4539
4 changed files with 15 additions and 17 deletions
|
@ -21,11 +21,11 @@ class RefLog {
|
|||
late final Pointer<git_reflog> _reflogPointer;
|
||||
|
||||
/// Returns a list with entries of reference log.
|
||||
List<RefLogEntry> list() {
|
||||
List<RefLogEntry> get entries {
|
||||
var log = <RefLogEntry>[];
|
||||
|
||||
for (var i = 0; i < count; i++) {
|
||||
log.add(entryAt(i));
|
||||
log.add(RefLogEntry(bindings.getByIndex(_reflogPointer, i)));
|
||||
}
|
||||
|
||||
return log;
|
||||
|
@ -38,8 +38,8 @@ class RefLog {
|
|||
///
|
||||
/// Requesting the reflog entry with an index of 0 (zero) will return
|
||||
/// the most recently created entry.
|
||||
RefLogEntry entryAt(int index) {
|
||||
return RefLogEntry(bindings.entryByIndex(_reflogPointer, index));
|
||||
RefLogEntry operator [](int index) {
|
||||
return RefLogEntry(bindings.getByIndex(_reflogPointer, index));
|
||||
}
|
||||
|
||||
/// Releases memory allocated for reflog object.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue