Clean up duplication functions in Facebook prpl

Review Request #1339 — Created March 13, 2022 and submitted

Information

pidgin/pidgin
default

Reviewers

  • Remove weird use of dup functions to allocate new structs
  • Replace shallow *_dup calls with g_memdup2 or g_new0
    For a shallow copy, it's far simpler to just call g_memdup2 directly.
    In a couple cases where most fields are replaced after, it's simpler to
    allocate a new struct entirely and just copy the one or two fields from the
    original.
  • Remove deep parameter from dup functions
    All callers all require deep copies now.

Compile only.

Summary ID
Remove weird use of dup functions to allocate new structs
d0fde7a4cfe3a7649431e88ede317398368b0c7e
Replace shallow *_dup calls with g_memdup2 or g_new0
For a shallow copy, it's far simpler to just call g_memdup2 directly. In a couple cases where most fields are replaced after, it's simpler to allocate a new struct entirely and just copy the one or two fields from the original.
7f4664d66a49798d83ec4fb184176fce8e7a04c4
Remove deep parameter from dup functions
All callers all require deep copies now.
4bfea5383ebce67a376ff9c75717202b8335e431
grim
  1. 
      
  2. Looks good, seeing a lot of complexity being removed here and that's very good, thanks!!

  3. 
      
grim
Review request changed
Status:
Completed