Merge lp://qastaging/~danilo/pygettextpo/simplify into lp://qastaging/pygettextpo

Proposed by Данило Шеган
Status: Superseded
Proposed branch: lp://qastaging/~danilo/pygettextpo/simplify
Merge into: lp://qastaging/pygettextpo
Diff against target: 169 lines (+40/-92)
1 file modified
gettextpo.c (+40/-92)
To merge this branch: bzr merge lp://qastaging/~danilo/pygettextpo/simplify
Reviewer Review Type Date Requested Status
Launchpad code reviewers Pending
Review via email: mp+86870@code.qastaging.launchpad.net

Description of the change

Simplify the C code behind simple set_msg* methods to facilitate code reuse.

Since I'd like to extend it to support all the other current features of libgettextpo, and a bunch of other methods would need the same code for executing a bunch of actions (set_msgctxt, set_extracted_comments...).

Alternative approach for this would have been to define a macro, which might be faster (no passing around of function pointers), but it would have resulted in larger binaries and would have been uglier (\ continuation lines and such).

'make check' confirms no tests are broken (all the modified methods are tested in a basic way, but that should be sufficient for the type of changes here).

To post a comment you must log in.
27. By Данило Шеган

Remove "helper" from the helper function name: it confused me a bare month after I introduced it because I read it as "helper message" instead of a "helper function on message class".

28. By Данило Шеган

Merge pep8-fixes.

Unmerged revisions

28. By Данило Шеган

Merge pep8-fixes.

27. By Данило Шеган

Remove "helper" from the helper function name: it confused me a bare month after I introduced it because I read it as "helper message" instead of a "helper function on message class".

26. By Данило Шеган

Reuse the new helper function in other similar methods.

25. By Данило Шеган

Extract po message setter pattern into a helper method.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches