<commit_before>/*global requestAnimationFrame*/
App.Looper = Looper;
function Looper(context, update, render, delta) {
  var _update = context[update];
  var _render = context[render];

  var stepTime = 0;
  var targetDelta = delta || (1 / 30 * 1000);

  var isLooping = false;
  var lastTime;

  function animateStep(delta) {
    stepTime += delta;
    var steps = Math.floor(stepTime / targetDelta);

    if (steps > 0) {
      stepTime -= steps * targetDelta;
    }

    while (steps > 0) {
      _update.call(context, targetDelta);
      steps --;
    }

    var stepProgress = stepTime / targetDelta;
    _render.call(context, targetDelta, stepProgress);
  }

  function animate() {
    if (!isLooping) { return; }
    var time = Date.now();
    var delta = time - lastTime;

    animateStep(delta);
    requestAnimationFrame(animate);
    lastTime = time;
  }

  this.stop = function () {<commit_msg>Add max step delta<commit_after>/*global requestAnimationFrame*/
App.Looper = Looper;
function Looper(context, update, render, delta) {
  var _update = context[update];
  var _render = context[render];

  var stepTime = 0;
  var targetDelta = delta || (1 / 30 * 1000);
  var maxDelta = targetDelta * 2;

  var isLooping = false;
  var lastTime;

  function animateStep(delta) {
    stepTime += delta;
    var steps = Math.floor(stepTime / targetDelta);

    if (steps > 0) {
      stepTime -= steps * targetDelta;
    }

    while (steps > 0) {
      _update.call(context, targetDelta);
      steps --;
    }

    var stepProgress = stepTime / targetDelta;
    _render.call(context, targetDelta, stepProgress);
  }

  function animate() {
    if (!isLooping) { return; }
    var time = Date.now();
    var delta = Math.min(maxDelta, time - lastTime);

    animateStep(delta);
    requestAnimationFrame(animate);
    lastTime = time;
  }

  this.stop = function () {
{'fraction_non_alphanumeric': 0.12346338856226617, 'fraction_numerical': 0.01122394441475147, 'mean_word_length': 2.949367088607595, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4301302', 'n_tokens_mistral': 623, 'n_tokens_neox': 577, 'n_words': 156}