Though this length shouldn't actually excedd 32 bits (othewise
too much data will be generated, and that is checked), it's better
to use size_t and don't care about the order of checks.
namespace skeleton
{
-Path::Path (const chars_t & cs, uint32_t l, rule_rank_t r)
+Path::Path (const chars_t & cs, size_t l, rule_rank_t r)
: chars (cs)
, length (l)
, rule (r)
length = chars.size () + p->length;
rule = p->rule;
}
- for (uint32_t i = 0; i < p->chars.size (); ++i)
+ const size_t sz = p->chars.size ();
+ for (size_t i = 0; i < sz; ++i)
{
chars.push_back (p->chars[i]);
}
typedef std::vector<uint32_t> chars_t;
chars_t chars;
- uint32_t length;
+ size_t length;
rule_rank_t rule;
- Path (const chars_t & cs, uint32_t l, rule_rank_t r);
+ Path (const chars_t & cs, size_t l, rule_rank_t r);
void update (rule_rank_t r);
void extend (rule_rank_t r, uint32_t c);
void append (const Path * p);