Skip to content

Commit

Permalink
Use 'explicit' to avoid incorrect code
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jkedgar committed Oct 5, 2015
1 parent 4f83430 commit 6aee154
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions storage/rocksdb/rdb_datadic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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();
Expand Down

0 comments on commit 6aee154

Please sign in to comment.