static int betterGetIndent(S s) { int n = Int.MAX_VALUE; for (line : linesIterator(s)) { line = rtrim(line); if (nempty(line)) { int indent = getIndentOfLine(line); if (indent < n) { n = indent; if (n == 0) ret 0; } } } ret n; }
Began life as a copy of #1002854
download show line numbers debug dex old transpilations
Travelled to 2 computer(s): mqqgnosmbjvj, wnsclhtenguj
No comments. add comment
Snippet ID: | #1036936 |
Snippet name: | betterGetIndent - getIndent + handling empty lines better |
Eternal ID of this version: | #1036936/5 |
Text MD5: | d85d61e1fdad3ad0fb439267bddd776b |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2023-07-24 21:33:56 |
Source code size: | 297 bytes / 14 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 116 / 154 |
Version history: | 4 change(s) |
Referenced in: | [show references] |