mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 20:59:08 -04:00
refactor: remove unnecessary local variables
This commit is contained in:
parent
cfa5268af2
commit
20ca75639d
48 changed files with 446 additions and 237 deletions
|
@ -33,6 +33,7 @@ Pointer<git_describe_result> commit({
|
|||
calloc.free(opts);
|
||||
|
||||
if (error < 0) {
|
||||
calloc.free(out);
|
||||
throw LibGit2Error(libgit2.git_error_last());
|
||||
} else {
|
||||
return out.value;
|
||||
|
@ -68,6 +69,7 @@ Pointer<git_describe_result> workdir({
|
|||
calloc.free(opts);
|
||||
|
||||
if (error < 0) {
|
||||
calloc.free(out);
|
||||
throw LibGit2Error(libgit2.git_error_last());
|
||||
} else {
|
||||
return out.value;
|
||||
|
@ -91,6 +93,8 @@ String format({
|
|||
);
|
||||
|
||||
if (optsError < 0) {
|
||||
calloc.free(out);
|
||||
calloc.free(opts);
|
||||
throw LibGit2Error(libgit2.git_error_last());
|
||||
}
|
||||
|
||||
|
@ -106,7 +110,10 @@ String format({
|
|||
|
||||
final error = libgit2.git_describe_format(out, describeResultPointer, opts);
|
||||
|
||||
calloc.free(opts);
|
||||
|
||||
if (error < 0) {
|
||||
calloc.free(out);
|
||||
throw LibGit2Error(libgit2.git_error_last());
|
||||
} else {
|
||||
final result = out.ref.ptr.cast<Utf8>().toDartString();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue