mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
style: move declarations of callbacks above the function they will be used in
This commit is contained in:
parent
a1d617e053
commit
5be0d0a6b5
2 changed files with 24 additions and 22 deletions
|
@ -81,8 +81,20 @@ bool exists({
|
|||
}
|
||||
|
||||
/// List of objects in the database.
|
||||
///
|
||||
/// IMPORTANT: make sure to clear that list since it's a global variable.
|
||||
var _objects = <Oid>[];
|
||||
|
||||
/// The callback to call for each object.
|
||||
int _forEachCb(
|
||||
Pointer<git_oid> oid,
|
||||
Pointer<Void> payload,
|
||||
) {
|
||||
final _oid = oid_bindings.copy(oid);
|
||||
_objects.add(Oid(_oid));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// List all objects available in the database.
|
||||
///
|
||||
/// Throws a [LibGit2Error] if error occured.
|
||||
|
@ -105,16 +117,6 @@ List<Oid> objects(Pointer<git_odb> odb) {
|
|||
return result;
|
||||
}
|
||||
|
||||
/// The callback to call for each object.
|
||||
int _forEachCb(
|
||||
Pointer<git_oid> oid,
|
||||
Pointer<Void> payload,
|
||||
) {
|
||||
final _oid = oid_bindings.copy(oid);
|
||||
_objects.add(Oid(_oid));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// Read an object from the database.
|
||||
///
|
||||
/// This method queries all available ODB backends trying to read the given OID.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue