commit 3188c3bd1454121210f5b04cc3cc4c31827e1860
parent 43670b464fc237b113f32d592af18c218a02bf1f
Author: Dominik Schmidt <das1993@hotmail.com>
Date: Fri, 24 Jul 2015 16:47:48 +0200
Use char[] as document-holder.
Iirc strings are immutable, so every append-operation is very expensive.
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Fb2RSS.d b/Fb2RSS.d
@@ -58,7 +58,7 @@ class FBStream : RandomFiniteAssignable!(Post){
///The generated data Nodes, which hold all relevant data.
XmlNode dataNodes[];
///The plaintext string holding the whole file
- string document;
+ char[] document;
/**
* The useragent to use for requesting the page with facebook.
* Facebook does check this, and if it doesn't know it, it displays an
@@ -190,7 +190,7 @@ class FBStream : RandomFiniteAssignable!(Post){
*/
public void fetch(){
if(exists(fetch_url) && isFile(fetch_url)){
- document=cast(string)read(fetch_url);
+ document=cast(char[])read(fetch_url);
}
else{
auto h=HTTP();
@@ -205,7 +205,7 @@ class FBStream : RandomFiniteAssignable!(Post){
*/
public void parse(){
XmlNode[] arr;
- root=readDocument(document);
+ root=readDocument(cast(string)document);
arr=root.parseXPath(`//meta[@property="og:url"]`);
url=arr[0].getAttribute("content");
arr=root.parseXPath(`//meta[@property="og:title"]`);