CouchDB
  1. CouchDB
  2. COUCHDB-765

load_view contains needles module prefixed function calls

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 0.11
    • Fix Version/s: 1.0
    • Component/s: Database Core
    • Labels:
      None

      Description

      It's only a cosmetic change. The load_view/4 in couch_httpd_view.erl contains some calls to functions within the module but prefixes the calls.

      1. load_view.patch
        2 kB
        Volker Mische

        Activity

        Hide
        Volker Mische added a comment -

        Patch for the cosmetic change.

        Show
        Volker Mische added a comment - Patch for the cosmetic change.
        Hide
        Adam Kocoloski added a comment -

        Hi Volker, just to clarify, that's not strictly a cosmetic change. A call to M:F(A) always uses the newest version of the code in the VM, while a call to F(A) uses whatever version is running when the call is made. The difference is critically important for hot-code loading in the case of a server loop function, e.g. if you do

        loop(State) ->
        ...
        loop(State).

        you'll never load a new version of the code, but if you do

        loop(State) ->
        ...
        ?MODULE:loop(State).

        you'll get the new version automatically when the loop recurses.

        Of course, it doesn't make any difference in this case, as hot-code loading is not an issue for those functions. Thanks for the patch.

        Show
        Adam Kocoloski added a comment - Hi Volker, just to clarify, that's not strictly a cosmetic change. A call to M:F(A) always uses the newest version of the code in the VM, while a call to F(A) uses whatever version is running when the call is made. The difference is critically important for hot-code loading in the case of a server loop function, e.g. if you do loop(State) -> ... loop(State). you'll never load a new version of the code, but if you do loop(State) -> ... ?MODULE:loop(State). you'll get the new version automatically when the loop recurses. Of course, it doesn't make any difference in this case, as hot-code loading is not an issue for those functions. Thanks for the patch.

          People

          • Assignee:
            Unassigned
            Reporter:
            Volker Mische
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development