Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re: The Ovidian Transform

by petral (Curate)
on Jan 02, 2002 at 18:04 UTC ( #135668=note: print w/replies, xml ) Need Help??


in reply to Re: The Ovidian Transform
in thread The Ovidian Transform

If you're not counting on some sort of optimization based on alignment why do a string copy at all?
while ( *str++ != '|' ); date[0] = str[4]; date[1] = str[5]; date[2] = str[6]; date[3] = str[7]; date[4] = str[0]; date[5] = str[1]; date[6] = str[2]; date[7] = str[3];
Or am I not remembering C correctly?

  p

Replies are listed 'Best First'.
Re: Re: Re: The Ovidian Transform
by jmcnamara (Monsignor) on Jan 02, 2002 at 22:24 UTC

    You are correct the strncpy is superfluous. The string terminator is missing but newSVpv() has been called with an explicit length so it doesn't matter.

    All in all I would prefer jcwren's methodology.

    --
    John (wishes there was a C-monks).

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://135668]
help
Chatterbox?
[LanX]: Choroba: do you miss chaos with ties? apply at the US government.. ;)
[ambrus]: Corion: those are good rules.
[ambrus]: Discipulus: oh sure. the input data has different filenames every time I get them.
[ambrus]: the directory structure may be 1, 2, or 3 deep, it may have spaces in the filename or not, it has dates in various format, different keywords for the same meanings, and the dates and other keywords are assembled in various ways.
[Discipulus]: no ambrus by specification i mean for example license per core instead of per socket, so fields are different

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2017-03-29 12:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (350 votes). Check out past polls.