apache / apache/ponymail

Enhance: elastic.lua getHeadersReverse/getHeaders could share code

Open
#147 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
80
Forks
32
PR merge metrics
No merged PRs in 30d

Description

The code for getHeadersReverse/getHeaders is basically the same apart from the sort field (but see #146) and the call to table.insert()

The code could be shared by using a common function that accepted a direction parameter.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in elastic.lua by comparing getHeadersReverse and getHeaders, especially their sort-field handling and table.insert() calls. Extract the shared behavior while preserving the differing direction and insertion behavior, then verify that both functions still return the expected headers.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
search
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.