File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -49,18 +49,21 @@ class csv_print
49
49
attr_dict attr_;
50
50
pub_key skey_;
51
51
std::string sym_;
52
+ bool do_sym_;
52
53
bool has_sym_;
53
54
};
54
55
55
56
csv_print::csv_print ()
56
57
: sym_id_( attr_id::add( " symbol" ) ),
58
+ do_sym_( false ),
57
59
has_sym_( false )
58
60
{
59
61
}
60
62
61
63
void csv_print::set_symbol ( const std::string& sym )
62
64
{
63
65
sym_ = sym;
66
+ do_sym_ = !sym_.empty ();
64
67
}
65
68
66
69
void csv_print::print_header ()
@@ -103,7 +106,7 @@ void csv_print::parse_product( replay& rep )
103
106
smap_.ref ( i ) = sym.as_string ();
104
107
105
108
// check if symbol matches filter
106
- if ( sym_ == sym.as_string () ) {
109
+ if ( do_sym_ && sym_ == sym.as_string () ) {
107
110
has_sym_ = true ;
108
111
skey_ = *aptr;
109
112
}
@@ -114,7 +117,7 @@ void csv_print::parse_price( replay& rep )
114
117
pc_price_t *ptr = (pc_price_t *)rep.get_update ();
115
118
pub_key *aptr = (pub_key*)&ptr->prod_ ;
116
119
// filter by symbol
117
- if ( has_sym_ && *aptr != skey_ ) {
120
+ if ( do_sym_ && (!has_sym_ || *aptr != skey_ ) ) {
118
121
return ;
119
122
}
120
123
char tbuf[32 ];
You can’t perform that action at this time.
0 commit comments