<commit_before>// utilities to create a graph of path segments and traverse that graph
'use strict'

var fill = require('lodash.fill')

var find = function (collection, condition) {
  var element
  var i

  for (i = 0; i < collection.length; i++) {
    element = collection[i]

    if (condition(element)) {
      return element
    }
  }
}

var findClosest = function (points, position, fillGaps) {
  var result = points.reduce(function (prev, point) {
    var d = distance(position, point.position)
    if (d < fillGaps && d < prev.distance) {
      return {point: point, distance: d}
    } else {
      return prev
    }
  }, {point: undefined, distance: Infinity})

  return result.point
}

var distance = function (point, target) {
  return Math.sqrt(Math.pow(point[0] - target[0], 2) + Math.pow(point[1] - target[1], 2))
}
<commit_msg>Remove superfluous else<commit_after>// utilities to create a graph of path segments and traverse that graph
'use strict'

var fill = require('lodash.fill')

var find = function (collection, condition) {
  var element
  var i

  for (i = 0; i < collection.length; i++) {
    element = collection[i]

    if (condition(element)) {
      return element
    }
  }
}

var findClosest = function (points, position, fillGaps) {
  var result = points.reduce(function (prev, point) {
    var d = distance(position, point.position)
    if (d < fillGaps && d < prev.distance) {
      return {point: point, distance: d}
    }
    return prev
  }, {point: undefined, distance: Infinity})

  return result.point
}

var distance = function (point, target) {
  return Math.sqrt(Math.pow(point[0] - target[0], 2) + Math.pow(point[1] - target[1], 2))
}

{'fraction_non_alphanumeric': 0.13118664281454978, 'fraction_numerical': 0.008348240906380441, 'mean_word_length': 3.3025641025641024, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6566258', 'n_tokens_mistral': 552, 'n_tokens_neox': 533, 'n_words': 171}