Page MenuHomePhabricator

db: Make functions referentially transparent
ClosedPublic

Authored by akanad on Nov 11 2018, 11:46 PM.

Details

Reviewers
JackDanielZ
Summary

this patch modify functions on db.c referentially transparent.

Diff Detail

Branch
transparent
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 7995
Build 7427: arc lint + arc unit
akanad requested review of this revision.Nov 11 2018, 11:46 PM
akanad created this revision.
akanad updated this revision to Diff 17303.Nov 11 2018, 11:52 PM

minor updates

akanad updated this revision to Diff 17304.Nov 12 2018, 12:05 AM

another minor update

JackDanielZ added inline comments.Nov 14 2018, 2:37 PM
src/bin/db.c
165

I don't think you need the TLS and the hash to be in the DB handler. The first is specific to the thread and doesn't depend on the chosen DB. The second depends on the config json only. In this way you dont need this struct at all.

372

Why _ to begin the variable name? Why not just let db? less diffs

374

not needed

390

same

2299

no need to adapt and to move

src/bin/db.h
7

Why do you need to add the Handler name? Why not just typedef struct _DB DB;?

9

DB* db_new? db_load, db_save...

17

db_widgets_get?

src/bin/gui.c
411–412

EINA_LIST_FREE

src/lib/common.h
180

Why is it needed?

JackDanielZ accepted this revision.Nov 27 2018, 11:54 AM

I modified the patch according to my reviews

This revision is now accepted and ready to land.Nov 27 2018, 11:54 AM
JackDanielZ closed this revision.Nov 27 2018, 11:55 AM