Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-47594

tiny waste of time in lib/accesslib.php

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6.5, 2.7.2, 2.8
    • Fix Version/s: 2.6.6, 2.7.3
    • Component/s: Other
    • Labels:
    • Testing Instructions:
      Hide

      Buy an atomic clock and verify each call to lib/accesslib.php saves few nanoseconds
      or
      look at the code and verify the following code
      if (empty($CFG->profileroles))

      { return array(); }

      no longer exists from line 3113 of 7lib/accesslib.php.

      More seriously: run unit tests lib/tests/accesslib_test.php

      Show
      Buy an atomic clock and verify each call to lib/accesslib.php saves few nanoseconds or look at the code and verify the following code if (empty($CFG->profileroles)) { return array(); } no longer exists from line 3113 of 7lib/accesslib.php. More seriously: run unit tests lib/tests/accesslib_test.php
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-47594_master

      Description

      Please read the code in
      https://github.com/moodle/moodle/blob/master/lib/accesslib.php#L3103
      and in
      https://github.com/moodle/moodle/blob/master/lib/accesslib.php#L3113

      As far as I can understand, the code in 3113 is a waste of time.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/Nov/14