Skip to content

Commit 4acf184

Browse files
massjhunsaker
authored andcommitted
[pythd] Update user::parse_get_product code.
1 parent c9b8ae5 commit 4acf184

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

pc/user.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -296,25 +296,25 @@ void user::parse_get_product_list( uint32_t itok )
296296

297297
void user::parse_get_product( uint32_t tok, uint32_t itok )
298298
{
299-
do {
300-
// unpack and verify parameters
301-
uint32_t ntok,ptok = jp_.find_val( tok, "params" );
302-
if ( ptok == 0 || jp_.get_type(ptok) != jtree::e_obj ) break;
303-
if ( 0 == (ntok = jp_.find_val( ptok, "account" ) ) ) break;
304-
pub_key pkey;
305-
pkey.init_from_text( jp_.get_str( ntok ) );
306-
product *prod = sptr_->get_product( pkey );
307-
if ( PC_UNLIKELY( !prod ) ) { add_unknown_symbol(itok); return; }
308-
309-
// create result
310-
add_header();
311-
jw_.add_key( "result", json_wtr::e_obj );
312-
prod->dump_json( jw_ );
313-
jw_.pop();
314-
add_tail( itok );
315-
return;
316-
} while( 0 );
317-
add_invalid_params( itok );
299+
// unpack and verify parameters
300+
uint32_t ptok = jp_.find_val( tok, "params" );
301+
if ( ptok == 0 || jp_.get_type(ptok) != jtree::e_obj )
302+
return add_invalid_params( itok );
303+
uint32_t ntok = jp_.find_val( ptok, "account" );
304+
if ( ntok == 0 )
305+
return add_invalid_params( itok );
306+
pub_key pkey;
307+
pkey.init_from_text( jp_.get_str( ntok ) );
308+
product *prod = sptr_->get_product( pkey );
309+
if ( PC_UNLIKELY( !prod ) )
310+
return add_unknown_symbol( itok );
311+
312+
// create result
313+
add_header();
314+
jw_.add_key( "result", json_wtr::e_obj );
315+
prod->dump_json( jw_ );
316+
jw_.pop();
317+
add_tail( itok );
318318
}
319319

320320
void user::parse_get_all_products( uint32_t itok )

0 commit comments

Comments
 (0)