| 2839 | } |
| 2840 | |
| 2841 | int ImTextCountLines(const char* in_text, const char* in_text_end) |
| 2842 | { |
| 2843 | if (in_text_end == NULL) |
| 2844 | in_text_end = in_text + ImStrlen(in_text); // FIXME-OPT: Not optimal approach, discourage use for now. |
| 2845 | int count = 0; |
| 2846 | while (in_text < in_text_end) |
| 2847 | { |
| 2848 | const char* line_end = (const char*)ImMemchr(in_text, '\n', in_text_end - in_text); |
| 2849 | in_text = line_end ? line_end + 1 : in_text_end; |
| 2850 | count++; |
| 2851 | } |
| 2852 | return count; |
| 2853 | } |
| 2854 | |
| 2855 | IM_MSVC_RUNTIME_CHECKS_RESTORE |
| 2856 |
no outgoing calls
no test coverage detected