ldo/ShaderTools — comment on commit d7e5b3bf353bf9e1aaddf515882cf8ae80f268ba
File:  line 0
By ldo:

The original code was doing 2 database lookups combined with a search through the two lists of loaded data in order to match up the preview image with the corresponding material name. I replaced these with a single database lookup that gives me the name and preview image at the same time.

When you see a 1:1 relationship between two tables like this, I think there’s no need for them to be separate tables, the preview image field should be moved to the MATERIALS table, and the RENDER table can disappear.