On 10/17/07, Michael Witten <mfwitten@mit.edu> wrote:
As already pointed out, this isn't the true waste. Run the following
Ruby script to determine the true waste:
------------ cut here -----------
TabWidth = 8
actual_size = 0
expanded_size = 0
ARGF.each_line do |line|
width = 0
line.each_byte do |byte|
width += (byte == ?\t) ? (TabWidth - (width % TabWidth)) : 1
end
actual_size += line.length
expanded_size += width
end
puts (expanded_size - actual_size).to_s
------------ cut here -----------
This will give you the actual space waste. Run it like so:
% ruby space-waste.rb /usr/src/linux/**/*.[ch]
(or in a similar manner that doesn't fail due to going over the
maximum command-line limit).
According to this calculation the waste is 47808782 bytes, or about
45.6 MiB, for 8-spaces-wide tabs.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html