| 785 | } |
| 786 | |
| 787 | static void ParseStringChoice(StringConsumer &consumer, uint form, StringBuilder &builder) |
| 788 | { |
| 789 | /* <NUM> {Length of each string} {each string} */ |
| 790 | uint n = consumer.ReadUint8(); |
| 791 | size_t form_pre = 0, form_len = 0, form_post = 0; |
| 792 | for (uint i = 0; i != n; i++) { |
| 793 | uint len = consumer.ReadUint8(); |
| 794 | if (i < form) { |
| 795 | form_pre += len; |
| 796 | } else if (i > form) { |
| 797 | form_post += len; |
| 798 | } else { |
| 799 | form_len = len; |
| 800 | } |
| 801 | } |
| 802 | |
| 803 | consumer.Skip(form_pre); |
| 804 | builder += consumer.Read(form_len); |
| 805 | consumer.Skip(form_post); |
| 806 | } |
| 807 | |
| 808 | /** Helper for unit conversion. */ |
| 809 | struct UnitConversion { |
no test coverage detected