about summary refs log tree commit diff stats
path: root/html/001help.cc.html
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-09-25 16:36:10 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-09-25 16:36:10 -0700
commit414b452ffb854c480e179727fba2c7f5ee502adc (patch)
tree13c2a7608b3ba8fd4bc54a1a263c011da2e2a095 /html/001help.cc.html
parent5c52642675692cc4e8a95caa674ff047e7bf9e00 (diff)
downloadmu-414b452ffb854c480e179727fba2c7f5ee502adc.tar.gz
3416
Diffstat (limited to 'html/001help.cc.html')
-rw-r--r--html/001help.cc.html5
1 files changed, 4 insertions, 1 deletions
diff --git a/html/001help.cc.html b/html/001help.cc.html
index 84c836c5..d96f3fe6 100644
--- a/html/001help.cc.html
+++ b/html/001help.cc.html
@@ -101,7 +101,10 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 <span class="Delimiter">}</span>
 
 <span class="Normal">bool</span> starts_with<span class="Delimiter">(</span><span class="Normal">const</span> string&amp; s<span class="Delimiter">,</span> <span class="Normal">const</span> string&amp; pat<span class="Delimiter">)</span> <span class="Delimiter">{</span>
-  <span class="Identifier">return</span> s<span class="Delimiter">.</span>substr<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">,</span> pat<span class="Delimiter">.</span>size<span class="Delimiter">())</span> == pat<span class="Delimiter">;</span>
+  string::const_iterator a=s<span class="Delimiter">.</span>begin<span class="Delimiter">(),</span> b=pat<span class="Delimiter">.</span>begin<span class="Delimiter">();</span>
+  <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Comment">/*</span><span class="Comment">nada</span><span class="Comment">*/</span><span class="Delimiter">;</span> a!=s<span class="Delimiter">.</span>end<span class="Delimiter">()</span> &amp;&amp; b!=pat<span class="Delimiter">.</span>end<span class="Delimiter">();</span> ++a<span class="Delimiter">,</span> ++b<span class="Delimiter">)</span>
+    <span class="Normal">if</span> <span class="Delimiter">(</span>*a != *b<span class="Delimiter">)</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span>
+  <span class="Identifier">return</span> b == pat<span class="Delimiter">.</span>end<span class="Delimiter">();</span>
 <span class="Delimiter">}</span>
 
 <span class="Comment">//: I'll throw some style conventions here for want of a better place for them.</span>