cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vladimir-kotikov <...@git.apache.org>
Subject [GitHub] cordova-windows pull request #212: CB-9287 Not enough Icons and Splashscreen...
Date Mon, 28 Nov 2016 09:10:55 GMT
Github user vladimir-kotikov commented on a diff in the pull request:

    https://github.com/apache/cordova-windows/pull/212#discussion_r89726251
  
    --- Diff: cordova-js-src/confighelper.js ---
    @@ -22,16 +22,17 @@
     // config.xml wrapper (non-node ConfigParser analogue)
     var config;
     function Config(xhr) {
    -    function loadPreferences(xhr) {
    +    function load(xhr, tagName) {
             var parser = new DOMParser();
             var doc = parser.parseFromString(xhr.responseText, "application/xml");
     
    -        var preferences = doc.getElementsByTagName("preference");
    +        var preferences = doc.getElementsByTagName(tagName);
             return Array.prototype.slice.call(preferences);
         }
     
         this.xhr = xhr;
    -    this.preferences = loadPreferences(this.xhr);
    +    this.preferences = load(this.xhr, "preference");
    +    this.splashScreens = load(this.xhr, "splash");
    --- End diff --
    
    Calling `load` second time here will trigger re-parsing of `config.xml` which, I believe,
is not very efficient. Might be better to rework `load` method to reuse already parsed document


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Mime
View raw message