Schlemiel the Painter's algorithm: Difference between revisions

Content deleted Content added
Wookie2u (talk | contribs)
Wookie2u (talk | contribs)
Line 57:
== The Solution ==
 
The solution to the performance degradation is to remember the-___location-of-end-of-the-string, to avoid the expense of repeatedly finding it. The following reimplimentation the traditional ''strcat'' function does this. It returns the-new-end which may then be passed to the '''next''' invocation of ''stringcat'', eliminating the overhead of finding the-end '''repeatedly'''.
 
The following is an enhanced reimplimentation the traditional ''strcat''. It returns the-new-end-of-the-destination-string which may then be passed to the '''next''' invocation of ''stringcat'', eliminating the overhead of finding it '''repeatedly'''.
 
<source lang="c">