mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
refactor(diff): break early from loop when condition met
This commit is contained in:
parent
03e2922517
commit
75b9ed6b57
1 changed files with 3 additions and 0 deletions
|
@ -140,6 +140,7 @@ class DiffDelta {
|
||||||
for (var type in GitDelta.values) {
|
for (var type in GitDelta.values) {
|
||||||
if (_diffDeltaPointer.ref.status == type.value) {
|
if (_diffDeltaPointer.ref.status == type.value) {
|
||||||
status = type;
|
status = type;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
|
@ -221,6 +222,7 @@ class DiffFile {
|
||||||
for (var mode in GitFilemode.values) {
|
for (var mode in GitFilemode.values) {
|
||||||
if (_diffFile.mode == mode.value) {
|
if (_diffFile.mode == mode.value) {
|
||||||
result = mode;
|
result = mode;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -338,6 +340,7 @@ class DiffLine {
|
||||||
for (var type in GitDiffLine.values) {
|
for (var type in GitDiffLine.values) {
|
||||||
if (originInt == type.value) {
|
if (originInt == type.value) {
|
||||||
result = type;
|
result = type;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue