8000 Potential Code optimization for stationsList.js file · Issue #41 · blackberry/WebWorks-Samples · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content < 8000 span style="width: 0%;" data-view-component="true" class="Progress-item progress-pjax-loader-bar left-0 top-0 color-bg-accent-emphasis">
This repository was archived by the owner on Sep 4, 2019. It is now read-only.
This repository was archived by the owner on Sep 4, 2019. It is now read-only.
Potential Code optimization for stationsList.js file #41
Open
@amobi

Description

@amobi

I realize that this is not really a big issue, but by factoring out the repetitive SQL insert statements in the Weather stationsList.js files, this file size could be cut down by approximately 50% i believe. For example:

var stationsList = ["insert into StationList (latitude, longitude, xml_url) values (-22.017, 166.217, 'NWWW');",
"insert into StationList (latitude, longitude, xml_url) values (-21.233, -175.15, 'NFTF');",
........
];

By removing the continuously repeated string in the statement, you can then place it once in the following block:

for (var i=0; i<arrLength; i++) {
tx.executeSql('insert into StationList (latitude, longitude, xml_url) values ('+stationsList[i]+');', null, incrementPercent);
}

The result would be a much smaller file size. As I previously mentioned, this may not be of much importance but it does cut down file size which in my opinion is always a good thing!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0