Skip to content

Commit

Permalink
use a single loop
Browse files Browse the repository at this point in the history
  • Loading branch information
mixonic committed Aug 11, 2015
1 parent 250a976 commit d94aacb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/js/models/markup-section.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,11 @@ export default class Section extends LinkedItem {
* Mutates this section's markers
*/
coalesceMarkers() {
forEach(
filter(this.markers, m => m.empty()),
m => this.markers.remove(m)
);
forEach(this.markers, m => {
if (m.empty()) {
this.markers.remove(m);
}
});
if (this.markers.empty()) {
this.markers.append(this.builder.createBlankMarker());
}
Expand Down

0 comments on commit d94aacb

Please sign in to comment.