nodestack: don't use C++ references
authorBrian Norris <banorris@uci.edu>
Sat, 23 Feb 2013 00:34:37 +0000 (16:34 -0800)
committerBrian Norris <banorris@uci.edu>
Sat, 23 Feb 2013 00:34:37 +0000 (16:34 -0800)
Just pass-by-value, since the reference can obfuscate the lifetime of,
for example, an automatic variable.

nodestack.cc
nodestack.h

index b2ef73cac30108fab56745f89b0542a186fc6410..59e9b5dcad8f9630b2e9dd7ad25a97728ea25458 100644 (file)
@@ -226,7 +226,7 @@ bool Node::misc_empty() const
  * @param value is the value to backtrack to.
  * @return True if the future value was successully added; false otherwise
  */
-bool Node::add_future_value(struct future_value& fv)
+bool Node::add_future_value(struct future_value fv)
 {
        uint64_t value = fv.value;
        modelclock_t expiration = fv.expiration;
index 47c72678aa13cffb9294e6a7d842860136e37baf..cd34ba42189977d25ed52e0a57b60c3ca25839ed 100644 (file)
@@ -71,7 +71,7 @@ public:
         * occurred previously in the stack. */
        Node * get_parent() const { return parent; }
 
-       bool add_future_value(struct future_value& fv);
+       bool add_future_value(struct future_value fv);
        struct future_value get_future_value() const;
        bool increment_future_value();
        bool future_value_empty() const;