Skip to content

Commit

Permalink
[Style] Fix checking errors by scripts (#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
kygx-legend authored Jun 29, 2017
1 parent cc20090 commit 0862b1d
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 23 deletions.
6 changes: 2 additions & 4 deletions core/channel/channel_store_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void ChannelStoreBase::drop_channel(const size_t id) {
void ChannelStoreBase::drop_channel(const std::string& channel_name) {
ChannelNameMap& channel_map = get_channel_name_map();
if (channel_map.find(channel_name) == channel_map.end())
throw base::HuskyException("ChannelStoreBase::drop_channel: Channel name "+channel_name+" doesn't exist");
throw base::HuskyException("ChannelStoreBase::drop_channel: Channel name " + channel_name + " doesn't exist");

drop_channel(channel_map.at(channel_name)->get_channel_id());
channel_map.erase(channel_name);
Expand Down Expand Up @@ -84,9 +84,7 @@ void ChannelStoreBase::free_channel_map() {
s_channel_name_map = nullptr;
}

ChannelIdMap& ChannelStoreBase::get_channel_map() {
return get_channel_id_map();
}
ChannelIdMap& ChannelStoreBase::get_channel_map() { return get_channel_id_map(); }

ChannelIdMap& ChannelStoreBase::get_channel_id_map() {
init_channel_map();
Expand Down
7 changes: 4 additions & 3 deletions core/channel/channel_store_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ class ChannelStoreBase {
}

template <typename MsgT, typename DstObjT>
static PushChannel<MsgT, DstObjT>& create_push_channel(ChannelSource& src_list, ObjList<DstObjT>& dst_list, const std::string& channel_name) {
static PushChannel<MsgT, DstObjT>& create_push_channel(ChannelSource& src_list, ObjList<DstObjT>& dst_list,
const std::string& channel_name) {
if (has_channel(channel_name)) {
throw base::HuskyException("A Channel named "+channel_name+" already exists.");
throw base::HuskyException("A Channel named " + channel_name + " already exists.");
}
auto& channel = create_push_channel<MsgT, DstObjT>(src_list, dst_list);
get_channel_name_map().insert({channel_name, &channel});
Expand All @@ -70,7 +71,7 @@ class ChannelStoreBase {
ObjList<DstObjT>& dst_list,
const std::string& channel_name) {
if (has_channel(channel_name)) {
throw base::HuskyException("A Channel named "+channel_name+" already exists.");
throw base::HuskyException("A Channel named " + channel_name + " already exists.");
}
auto& channel = create_push_combined_channel<MsgT, CombineT, DstObjT>(src_list, dst_list);
get_channel_name_map().insert({channel_name, &channel});
Expand Down
4 changes: 1 addition & 3 deletions core/objlist_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ void ObjListStore::free_objlist_map() {
s_objlist_name_map = nullptr;
}

ObjListIdMap& ObjListStore::get_objlist_map() {
return get_objlist_id_map();
}
ObjListIdMap& ObjListStore::get_objlist_map() { return get_objlist_id_map(); }

ObjListIdMap& ObjListStore::get_objlist_id_map() {
init_objlist_map();
Expand Down
2 changes: 1 addition & 1 deletion core/objlist_store.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ObjListStore {
static ObjList<ObjT>& create_objlist(const std::string& list_name) {
ObjListNameMap& objlist_name_map = get_objlist_name_map();
if (has_objlist(list_name)) {
throw base::HuskyException("A ObjList named "+list_name+" already exists.");
throw base::HuskyException("A ObjList named " + list_name + " already exists.");
}
auto& objlist = create_objlist<ObjT>();
objlist_name_map.insert({list_name, &objlist});
Expand Down
2 changes: 2 additions & 0 deletions examples/wc_mr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <set>
#include <string>
#include <utility>
#include <vector>

#include "boost/tokenizer.hpp"
Expand Down
11 changes: 6 additions & 5 deletions io/input/flume_inputformat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "io/input/flume_inputformat.hpp"

#include <unistd.h>
#include <cstring>
#include <iostream>
Expand All @@ -30,12 +32,11 @@
#include "base/log.hpp"
#include "boost/utility/string_ref.hpp"
#include "core/context.hpp"
#include "io/input/flume_inputformat.hpp"

using namespace ::apache::thrift;
using namespace ::apache::thrift::protocol;
using namespace ::apache::thrift::transport;
using namespace ::apache::thrift::server;
using namespace ::apache::thrift; // NOLINT(build/namespaces)
using namespace ::apache::thrift::protocol; // NOLINT(build/namespaces)
using namespace ::apache::thrift::transport; // NOLINT(build/namespaces)
using namespace ::apache::thrift::server; // NOLINT(build/namespaces)

using boost::shared_ptr;

Expand Down
8 changes: 4 additions & 4 deletions io/input/flume_inputformat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
#include "boost/utility/string_ref.hpp"
#include "io/input/inputformat_base.hpp"

using namespace ::apache::thrift;
using namespace ::apache::thrift::protocol;
using namespace ::apache::thrift::transport;
using namespace ::apache::thrift::server;
using namespace ::apache::thrift; // NOLINT(build/namespaces)
using namespace ::apache::thrift::protocol; // NOLINT(build/namespaces)
using namespace ::apache::thrift::transport; // NOLINT(build/namespaces)
using namespace ::apache::thrift::server; // NOLINT(build/namespaces)

using boost::shared_ptr;

Expand Down
4 changes: 1 addition & 3 deletions lib/aggregator_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ AggregatorFactory::InnerSharedData* AggregatorFactory::create_shared_data() { re

void AggregatorFactory::wait_for_others() { shared_->barrier.wait(get_num_local_factory()); }

void AggregatorFactory::call_once(const std::function<void()>& lambda) {
shared_->call_once_each_time(lambda);
}
void AggregatorFactory::call_once(const std::function<void()>& lambda) { shared_->call_once_each_time(lambda); }

void AggregatorFactory::init_factory() {
AggregatorFactoryBase::init_factory();
Expand Down

0 comments on commit 0862b1d

Please sign in to comment.