- while(!got_token && chain->steps->more_tokens)
- got_token = icu_chain_step_next_token(chain, chain->steps, status);
-
- if (got_token){
- chain->token_count++;
+ /* special case with no steps - same as index type binary */
+ if (!chain->steps)
+ {
+ if (chain->token_count)
+ return 0;
+ else
+ {
+ chain->token_count++;
+
+ if (chain->sort)
+ icu_sortkey8_from_utf16(chain->coll,
+ chain->sort8, chain->steps->buf16,
+ status);
+ return chain->token_count;
+ }
+ }
+ /* usual case, one or more icu chain steps existing */
+ else
+ {
+ while(!got_token && chain->steps && chain->steps->more_tokens)
+ got_token = icu_chain_step_next_token(chain, chain->steps, status);