瀏覽代碼

v.random: simplify code (cosmetics)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@44721 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 14 年之前
父節點
當前提交
9743724879
共有 1 個文件被更改,包括 2 次插入4 次删除
  1. 2 4
      vector/v.random/main.c

+ 2 - 4
vector/v.random/main.c

@@ -156,10 +156,8 @@ int main(int argc, char *argv[])
 	G_fatal_error(_("Number of points must be > 0 (%d given)"), n);
     }
 
-    if (flag.z->answer)
-	Vect_open_new(&Out, output, WITH_Z);
-    else
-	Vect_open_new(&Out, output, WITHOUT_Z);
+    /* create new vector map */
+    Vect_open_new(&Out, output, flag.z->answer ? WITH_Z : WITHOUT_Z);
 
     /* Do we need to write random values into attribute table? */
     if (parm.zcol->answer) {