Skip to content

RichString_setAttrn: refactor to take a length instead of a stop index#460

Merged
fasterit merged 1 commit intohtop-dev:masterfrom
cgzones:RichString_attrn
Jan 11, 2021
Merged

RichString_setAttrn: refactor to take a length instead of a stop index#460
fasterit merged 1 commit intohtop-dev:masterfrom
cgzones:RichString_attrn

Conversation

@cgzones
Copy link
Copy Markdown
Member

@cgzones cgzones commented Jan 10, 2021

Fixes: #459

@cgzones cgzones added this to the 3.0.5 milestone Jan 10, 2021
@cgzones cgzones requested review from BenBE and fasterit January 10, 2021 10:44
Copy link
Copy Markdown
Member

@BenBE BenBE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Some minor optional points for consideration.

Comment thread Process.c Outdated
Comment thread Process.c
Comment thread RichString.c Outdated
Comment thread RichString.c Outdated
Comment thread RichString.c Outdated
Comment on lines 80 to 81
ch->attr = attrs;
ch++;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: Keep ch const and use ch[i]->attr for access.

Comment thread RichString.c Outdated
Comment on lines 117 to 118
*ch = (*ch & 0xff) | attrs;
ch++;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: dito.

@fasterit fasterit merged commit 8a67d7f into htop-dev:master Jan 11, 2021
@cgzones cgzones deleted the RichString_attrn branch January 11, 2021 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

htop, run strace (key s) -> assert fails / segfaults

3 participants