Re: [aur-dev] [PATCH] voters.php: Remove extra call to pkgname_from_id()

2014-01-20 Thread Lukas Fleischer
On Mon, 20 Jan 2014 at 02:27:49, canyonknight wrote:
> No need to store package ID and call pkgname_from_id() twice when
> the end goal is the package name.
> 
> Signed-off-by: canyonknight 
> ---
>  web/html/voters.php | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 

Good catch. Merged, thanks!

> diff --git a/web/html/voters.php b/web/html/voters.php
> index 9cedeef..42fe2b5 100644
> --- a/web/html/voters.php
> +++ b/web/html/voters.php
> @@ -4,8 +4,7 @@ include_once('aur.inc.php');
>  include_once('pkgfuncs.inc.php');
>  
>  $SID = $_COOKIE['AURSID'];
> -
> -$pkgid = intval($_GET['ID']);
> +$pkgname = pkgname_from_id(intval($_GET['ID']);
>  $votes = getvotes($pkgid);
>  $atype = account_from_sid($SID);
>  
> @@ -15,7 +14,7 @@ if ($atype == 'Trusted User' || $atype== 'Developer'):
>  ?>
>  
>  
> -   Votes for 
> +   Votes for  ?>
> 
> 
> 
> -- 
> 1.8.5.3
> 


[aur-dev] [PATCH] voters.php: Remove extra call to pkgname_from_id()

2014-01-19 Thread canyonknight
No need to store package ID and call pkgname_from_id() twice when
the end goal is the package name.

Signed-off-by: canyonknight 
---
 web/html/voters.php | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/web/html/voters.php b/web/html/voters.php
index 9cedeef..42fe2b5 100644
--- a/web/html/voters.php
+++ b/web/html/voters.php
@@ -4,8 +4,7 @@ include_once('aur.inc.php');
 include_once('pkgfuncs.inc.php');
 
 $SID = $_COOKIE['AURSID'];
-
-$pkgid = intval($_GET['ID']);
+$pkgname = pkgname_from_id(intval($_GET['ID']);
 $votes = getvotes($pkgid);
 $atype = account_from_sid($SID);
 
@@ -15,7 +14,7 @@ if ($atype == 'Trusted User' || $atype== 'Developer'):
 ?>
 
 
-   Votes for 
+   Votes for 



-- 
1.8.5.3