[Commits] [wesnoth/wesnoth] 7adde8: lua: change a reference variable to a non-referenc...

GitHub noreply at github.com
Tue Jan 6 05:03:21 UTC 2015


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 7adde8af9c83aeaabf5744d8b07a2283eac9b207
      https://github.com/wesnoth/wesnoth/commit/7adde8af9c83aeaabf5744d8b07a2283eac9b207
  Author: Chris Beck <render787 at gmail.com>
  Date:   2015-01-06 (Tue, 06 Jan 2015)

  Changed paths:
    M src/scripting/game_lua_kernel.cpp

  Log Message:
  -----------
  lua: change a reference variable to a non-reference type

This line was not an error -- it is legal in C++ to bind a const
reference to a temporary value. It's only slightly more confusing
than usual in this case because the string it is built from is
a C-string owned by lua, and the temporary std::string object is
implicit.

I don't believe this commit will even make any difference in the
compiled code, it's only slightly simpler and more readable.





More information about the Commits mailing list