Thread (95 messages) flat view 95 messages, 33 authors, 2016-06-15

Re: On Tabs and Spaces

From: Michael Witten <hidden>
Date: 2016-06-15 22:43:42

On 17 Oct 2007, at 6:21:30 AM, Nikolai Weibull wrote:
According to this calculation the waste is 47808782 bytes, or about
45.6 MiB, for 8-spaces-wide tabs.
I concede my calculation was crude.

Interestingly, modifying my calculation to look
for tabs at the beginning of the line gives a
similar result:

     # calculates the extra space required to
     # use the given number of spaces/tab.
     size()
     {
         count=`grep -RIo "^\`printf \"\t\"\`" . | wc -l`;
         perl -e "print $count*$(($1-1))/1024/1024 . \" MiB\n\"";
     }

     size 8; => 49.7416791915894 MiB

and for git:
	
     size 8; => 1.25082969665527 MiB


Anyway, thanks for the neat script.

mfwitten
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help