Skip to content

Commit

Permalink
Another optimization of "bp" adding when creating a file_struct.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wayne Davison committed Mar 15, 2008
1 parent fc3ca11 commit cfdb27b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions flist.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,6 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
bp += FILE_STRUCT_LEN;

memcpy(bp, basename, basename_len);
bp += basename_len;

#ifdef SUPPORT_HARD_LINKS
if (xflags & XMIT_HLINKED)
Expand Down Expand Up @@ -919,6 +918,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist,

#ifdef SUPPORT_LINKS
if (linkname_len) {
bp += basename_len;
if (first_hlink_ndx >= flist->ndx_start) {
struct file_struct *first = flist->files[first_hlink_ndx - flist->ndx_start];
memcpy(bp, F_SYMLINK(first), linkname_len);
Expand Down Expand Up @@ -1177,7 +1177,6 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
bp += FILE_STRUCT_LEN;

memcpy(bp, basename, basename_len);
bp += basename_len;

#ifdef SUPPORT_HARD_LINKS
if (preserve_hard_links && flist && flist->prev) {
Expand Down Expand Up @@ -1216,7 +1215,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,

#ifdef SUPPORT_LINKS
if (linkname_len)
memcpy(bp, linkname, linkname_len);
memcpy(bp + basename_len, linkname, linkname_len);
#endif

if (always_checksum && am_sender && S_ISREG(st.st_mode))
Expand Down

0 comments on commit cfdb27b

Please sign in to comment.