about summary refs log tree commit diff
diff options
context:
space:
mode:
authorwhitequark <whitequark@whitequark.org>2015-09-20 22:19:30 +0300
committerwhitequark <whitequark@whitequark.org>2015-09-20 22:23:35 +0300
commit77f5da77a91af88130fcff3e726931934c71ba3f (patch)
treedf2d4575988712fc262efb86f6d32ab184b021c2
parent6beb4ba1aaecb59fdfdc676434b5a3b17a4b5bfc (diff)
downloadrust-77f5da77a91af88130fcff3e726931934c71ba3f.tar.gz
rust-77f5da77a91af88130fcff3e726931934c71ba3f.zip
Add comment.
-rw-r--r--src/libcollections/vec.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs
index ddab16493f0..4110faa41b3 100644
--- a/src/libcollections/vec.rs
+++ b/src/libcollections/vec.rs
@@ -1323,6 +1323,8 @@ impl<T> Drop for Vec<T> {
         // don't need unsafe_no_drop_flag shenanigans anymore.
         if self.buf.unsafe_no_drop_flag_needs_drop() {
             unsafe {
+                // The branch on needs_drop() is an -O1 performance optimization.
+                // Without the branch, dropping Vec<u8> takes linear time.
                 if needs_drop::<T>() {
                     for x in self.iter_mut() {
                         drop_in_place(x);