From 6aee154fe012fc05d21e46d381d32c3705fb5009 Mon Sep 17 00:00:00 2001 From: Jay Edgar Date: Fri, 2 Oct 2015 15:45:47 -0700 Subject: [PATCH] Use 'explicit' to avoid incorrect code Summary: A single argument constructor could accidentely be used as a type conversion constructor. Add 'explicit' keyword to avoid this. Squash with Issue #4: Efficient VARCHAR storage for keys Test Plan: MTR Reviewers: jtolmer, hermanlee4 Reviewed By: hermanlee4 Differential Revision: https://reviews.facebook.net/D48069 --- storage/rocksdb/rdb_datadic.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/rocksdb/rdb_datadic.h b/storage/rocksdb/rdb_datadic.h index fdadf4c14ceb..99797443e3e2 100644 --- a/storage/rocksdb/rdb_datadic.h +++ b/storage/rocksdb/rdb_datadic.h @@ -97,7 +97,7 @@ class Stream_reader const char* ptr; uint len; public: - Stream_reader(const std::string &str) + explicit Stream_reader(const std::string &str) { len= str.length(); if (len) @@ -114,7 +114,7 @@ class Stream_reader } } - Stream_reader(const rocksdb::Slice *slice) + explicit Stream_reader(const rocksdb::Slice *slice) { ptr= slice->data(); len= slice->size();