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

tiny waste of time in lib/accesslib.php

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.6.5, 2.7.2, 2.8
    • 2.6.6, 2.7.3
    • Other
    • MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
    • MOODLE_26_STABLE, MOODLE_27_STABLE
    • MDL-47594_master
    • Easy
    • 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

    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

            daniss Daniele Cordella
            daniss Daniele Cordella
            Simey Lameze Simey Lameze
            Sam Hemelryk Sam Hemelryk
            Mark Nelson Mark Nelson
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              10/Nov/14