<commit_before>"use strict";

angular.module('arethusa.core').directive('exit', [
  'exitHandler',
  function(exitHandler) {
    return {
      restrict: 'A',
      scope: {},
      link: function(scope, element, attrs) {
        if (exitHandler.defined) {
          element.bind('click', function(event) {
            var targetWin;
            var button = event.button;
            // Mirroring the different behavior of left and middle click
            if (button === 0) targetWin = "_self";
            if (button === 1) targetWin = "_blank";

            // We don't pass targetWin and hardcode _self for now as we don't
            // want the user to exit to a new tab - we leave the code in
            // though, in case we change our mind one day.

            scope.$apply(exitHandler.leave("_self"));
          });
          element.attr("title", "Exit to " + exitHandler.title);
        } else {
          element.hide(); // or even remove?
        }
<commit_msg>Remove useless scope.$apply in exit directive<commit_after>"use strict";

angular.module('arethusa.core').directive('exit', [
  'exitHandler',
  function(exitHandler) {
    return {
      restrict: 'A',
      scope: {},
      link: function(scope, element, attrs) {
        if (exitHandler.defined) {
          element.bind('click', function(event) {
            var targetWin;
            var button = event.button;
            // Mirroring the different behavior of left and middle click
            if (button === 0) targetWin = "_self";
            if (button === 1) targetWin = "_blank";

            // We don't pass targetWin and hardcode _self for now as we don't
            // want the user to exit to a new tab - we leave the code in
            // though, in case we change our mind one day.

            exitHandler.leave("_self");
          });
          element.attr("title", "Exit to " + exitHandler.title);
        } else {
          element.hide(); // or even remove?
        }

{'fraction_non_alphanumeric': 0.12056737588652482, 'fraction_numerical': 0.002026342451874367, 'mean_word_length': 1.9302670623145401, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6525991', 'n_tokens_mistral': 535, 'n_tokens_neox': 523, 'n_words': 177}