Skip to content

Commit 3af88d2

Browse files
committed
remove else
1 parent f75c870 commit 3af88d2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/jblond/Diff.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,10 @@ public function getOld(int $start = 0, $end = null) : array
129129
}
130130

131131
if ($end === null) {
132-
$length = 1;
133-
} else {
134-
$length = $end - $start;
132+
return array_slice($this->old, $start, 1);
135133
}
136134

135+
$length = $end - $start;
137136
return array_slice($this->old, $start, $length);
138137
}
139138

@@ -154,11 +153,10 @@ public function getNew(int $start = 0, $end = null) : array
154153
}
155154

156155
if ($end === null) {
157-
$length = 1;
158-
} else {
159-
$length = $end - $start;
156+
return array_slice($this->new, $start, 1);
160157
}
161158

159+
$length = $end - $start;
162160
return array_slice($this->new, $start, $length);
163161
}
164162

0 commit comments

Comments
 (0)