Skip to content

Commit 23263b0

Browse files
committed
Fix code smells
1 parent 49fafcf commit 23263b0

File tree

6 files changed

+17
-18
lines changed

6 files changed

+17
-18
lines changed

libraries/chain/credit_offer_evaluator.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,8 @@ void_result credit_offer_update_evaluator::do_apply( const credit_offer_update_o
189189
if( op.delta_amount.valid() )
190190
d.adjust_balance( op.owner_account, -(*op.delta_amount) );
191191

192-
d.modify( *_offer, [&op,this]( credit_offer_object& coo ){
193-
if( op.delta_amount.valid() )
194-
{
192+
d.modify( *_offer, [&op]( credit_offer_object& coo ){
193+
if( op.delta_amount.valid() ) {
195194
coo.total_balance += op.delta_amount->amount;
196195
coo.current_balance += op.delta_amount->amount;
197196
}

libraries/chain/db_notify.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,12 +500,12 @@ void get_relevant_accounts( const object* obj, flat_set<account_id_type>& accoun
500500
FC_ASSERT( aobj != nullptr );
501501
accounts.insert( aobj->owner_account );
502502
break;
503-
} case credit_offer_object_type:{
503+
} case credit_offer_object_type:{
504504
const auto* aobj = dynamic_cast<const credit_offer_object*>( obj );
505505
FC_ASSERT( aobj != nullptr );
506506
accounts.insert( aobj->owner_account );
507507
break;
508-
} case credit_deal_object_type:{
508+
} case credit_deal_object_type:{
509509
const auto* aobj = dynamic_cast<const credit_deal_object*>( obj );
510510
FC_ASSERT( aobj != nullptr );
511511
accounts.insert( aobj->offer_owner );
@@ -575,7 +575,7 @@ void get_relevant_accounts( const object* obj, flat_set<account_id_type>& accoun
575575
accounts.insert( aobj->bidder );
576576
break;
577577
} case impl_credit_deal_summary_object_type:{
578-
const auto& aobj = dynamic_cast<const credit_deal_summary_object*>(obj);
578+
const auto* aobj = dynamic_cast<const credit_deal_summary_object*>(obj);
579579
FC_ASSERT( aobj != nullptr );
580580
accounts.insert( aobj->offer_owner );
581581
accounts.insert( aobj->borrower );

libraries/protocol/include/graphene/protocol/credit_offer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ namespace graphene { namespace protocol {
184184
void validate()const override { FC_ASSERT( !"virtual operation" ); }
185185

186186
/// This is a virtual operation; there is no fee
187-
share_type calculate_fee(const fee_parameters_type& k)const { return 0; }
187+
share_type calculate_fee(const fee_parameters_type&)const { return 0; }
188188
};
189189

190190
} } // graphene::protocol

libraries/wallet/operation_printer.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,28 +364,28 @@ std::string operation_result_printer::operator()(const void_result& x) const
364364
return "";
365365
}
366366

367-
std::string operation_result_printer::operator()(const object_id_type& oid)
367+
std::string operation_result_printer::operator()(const object_id_type& oid) const
368368
{
369369
return std::string(oid);
370370
}
371371

372-
std::string operation_result_printer::operator()(const asset& a)
372+
std::string operation_result_printer::operator()(const asset& a) const
373373
{
374374
return _wallet.get_asset(a.asset_id).amount_to_pretty_string(a);
375375
}
376376

377-
std::string operation_result_printer::operator()(const generic_operation_result& r)
377+
std::string operation_result_printer::operator()(const generic_operation_result& r) const
378378
{
379379
return fc::json::to_string(r);
380380
}
381381

382-
std::string operation_result_printer::operator()(const generic_exchange_operation_result& r)
382+
std::string operation_result_printer::operator()(const generic_exchange_operation_result& r) const
383383
{
384384
// TODO show pretty amounts instead of raw json
385385
return fc::json::to_string(r);
386386
}
387387

388-
std::string operation_result_printer::operator()(const extendable_operation_result& r)
388+
std::string operation_result_printer::operator()(const extendable_operation_result& r) const
389389
{
390390
// TODO show pretty amounts instead of raw json
391391
return fc::json::to_string(r);

libraries/wallet/operation_printer.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ struct operation_result_printer
4545
typedef std::string result_type;
4646

4747
std::string operator()(const graphene::protocol::void_result& x) const;
48-
std::string operator()(const graphene::protocol::object_id_type& oid);
49-
std::string operator()(const graphene::protocol::asset& a);
50-
std::string operator()(const graphene::protocol::generic_operation_result& r);
51-
std::string operator()(const graphene::protocol::generic_exchange_operation_result& r);
52-
std::string operator()(const graphene::protocol::extendable_operation_result& r);
48+
std::string operator()(const graphene::protocol::object_id_type& oid) const;
49+
std::string operator()(const graphene::protocol::asset& a) const;
50+
std::string operator()(const graphene::protocol::generic_operation_result& r) const;
51+
std::string operator()(const graphene::protocol::generic_exchange_operation_result& r) const;
52+
std::string operator()(const graphene::protocol::extendable_operation_result& r) const;
5353
};
5454

5555
// BLOCK TRX OP VOP

libraries/wallet/wallet_builder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ namespace graphene { namespace wallet { namespace detail {
113113
pcop.expiration_time = expiration;
114114
signed_transaction& trx = _builder_transactions[handle];
115115
std::transform(trx.operations.begin(), trx.operations.end(), std::back_inserter(pcop.proposed_ops),
116-
[](const operation& op) -> op_wrapper { return op_wrapper(op); });
116+
[](const operation& op) { return op_wrapper(op); });
117117
if( review_period_seconds )
118118
pcop.review_period_seconds = review_period_seconds;
119119
trx.operations = {pcop};

0 commit comments

Comments
 (0)