Re: Memory allocation overhead

Colin Paul Adams <[email protected]>
Newsgroups gmane.comp.lang.eiffel.gobo.devel
Message-ID <[email protected]>
>>>>> "Eric" == Eric Bezault <[email protected]> writes:

    Eric> Otherwise I try to be very careful with
    Eric> strings. String concatenations and substring operations
    Eric> create a lot of intermediary objects. Be careful as well
    Eric> when strings get resized (even implicitly by some
    Eric> operations).

Is there a more efficient way of doing this sort of thing?

   a_preceding_path := parent.path
    if STRING_.same_string (a_preceding_path, "/") then
	Result := STRING_.concat (a_preceding_path, node_name)
    else
	Result := STRING_.concat (a_preceding_path, "/")
	Result := STRING_.appended_string (Result, node_name)
	Result := STRING_.appended_string (Result, "[")
	Result := STRING_.appended_string (Result, simple_number)
	Result := STRING_.appended_string (Result, "]")
    end
-- 
Colin Adams
Preston Lancashire

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.