]> rtime.felk.cvut.cz Git - edu/osp-wiki.git/commitdiff
(no commit message)
authormachaj41 <machaj41@web>
Thu, 5 Mar 2015 10:37:42 +0000 (11:37 +0100)
committerOSP robot <osp@rtime.felk.cvut.cz>
Thu, 5 Mar 2015 10:37:42 +0000 (11:37 +0100)
student/machaj41/index.mdwn

index ab595a6b7728408882deeddd96a69894205c2c11..fd0cbc74e91b60ed0840ece603cd91d63b8f9068 100644 (file)
@@ -5,7 +5,15 @@
 Assignment
 ======
 
-Description of my planned/completed work for the project
+In PasswordStore and derived and related classes, we often use ScopedVector. Sometimes, we create a single element, hold it in scoped_ptr, and pass it into a ScopedVector later. So far, this has been done like:
+
+vector.push_back(ptr.release());
+
+After [https://codereview.chromium.org/855003005](https://codereview.chromium.org/855003005), this can be done like
+
+vector.push_back(ptr.Pass());
+
+It is a very subtle change, but the latter code is better readable, and more clearly express the intent (not drop the pointer and catch it again, but pass).
 
 Links documenting the results of my work
 ======