<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Oct 22, 2013, at 1:57 PM, Yuchen Wu <<a href="mailto:yuchenericwu@hotmail.com">yuchenericwu@hotmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">


<div class="hmmessage"><div dir="ltr"><font size="3" face="Calibri">Use a map instead of vector to store line counts.</font><br>
<font size="3" face="Calibri"><br></font><br>
<font size="3" face="Calibri">There are a few motivations for this:</font><br>
<ul><li><span style="font-family: Calibri; font-size: 12pt;">Using a map allows for checking if line is in map. This differentiates </span><span style="font-family: Calibri; font-size: 12pt;">unexecutable lines (such as comments) from unexecuted logical lines of </span><span style="font-family: Calibri; font-size: 12pt;">code. "#####" is now outputted in this case, as it is done in gcov.</span></li><li><span style="font-family: Calibri; font-size: 12pt;">Source files are no longer read in twice: once when storing the line </span><span style="font-family: Calibri; font-size: 12pt;">counts, and once when outputting the data.</span></li><li><span style="font-family: Calibri; font-size: 12pt;">Greatly simplifies the function FileInfo::addLineCount().</span></li></ul></div></div></blockquote></div><div>I had some concerns about the performance of using a DenseMap for a very large source files, but after thinking about it, I think this is fine.  I suspect the difference won't even be measurable, and I like the idea of starting with simple code and then if it turns out to have performance issues, we can make it faster later.</div><div><br></div><div>Go ahead and commit this.</div><style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></body></html>